group(function () { Route::resource('page', 'PageResourceController'); }); 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', 'PageResourceController'); }); // Public routes for pages Route::get('newcms/', 'PagePublicController@index'); Route::get('newcms/{slug?}', 'PagePublicController@show'); } ); } // web routes for category Route::prefix('{guard}/newcm')->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('newcms/', 'CategoryPublicController@index'); Route::get('newcms/{slug?}', 'CategoryPublicController@show'); } ); }