group(function () { Route::get('unit/form/{element}', 'UnitAPIController@form'); Route::resource('unit', 'UnitAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for items Route::prefix('{guard}/item')->group(function () { Route::get('unit/form/{element}', 'UnitAPIController@form'); Route::apiResource('unit', 'UnitAPIController'); }); // Public routes for items Route::get('item/Unit', 'UnitPublicController@getUnit'); } ); } // API routes for item Route::prefix('{guard}/item')->group(function () { Route::get('item/form/{element}', 'ItemAPIController@form'); Route::resource('item', 'ItemAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for items Route::prefix('{guard}/item')->group(function () { Route::get('item/form/{element}', 'ItemAPIController@form'); Route::apiResource('item', 'ItemAPIController'); }); // Public routes for items Route::get('item/Item', 'ItemPublicController@getItem'); } ); } // API routes for category Route::prefix('{guard}/item')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::resource('category', 'CategoryAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for items Route::prefix('{guard}/item')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::apiResource('category', 'CategoryAPIController'); }); // Public routes for items Route::get('item/Category', 'CategoryPublicController@getCategory'); } ); }