group(function () { Route::resource('unit', 'UnitResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'UnitResourceController'); }); // Public routes for pages Route::get('items/', 'UnitPublicController@index'); Route::get('items/{slug?}', 'UnitPublicController@show'); } ); } // web routes for item Route::prefix('{guard}/item')->group(function () { Route::resource('item', 'ItemResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'ItemResourceController'); }); // Public routes for pages Route::get('items/', 'ItemPublicController@index'); Route::get('items/{slug?}', 'ItemPublicController@show'); } ); } // web routes for category Route::prefix('{guard}/item')->group(function () { Route::resource('category', 'CategoryResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'CategoryResourceController'); }); // Public routes for pages Route::get('items/', 'CategoryPublicController@index'); Route::get('items/{slug?}', 'CategoryPublicController@show'); } ); }