group(function () { Route::resource('website', 'WebsiteResourceController'); }); // Public routes for website Route::get('websites/', 'WebsitePublicController@index'); Route::get('websites/{slug?}', 'WebsitePublicController@show'); 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', 'WebsiteResourceController'); }); // Public routes for pages Route::get('websites/', 'WebsitePublicController@index'); Route::get('websites/{slug?}', 'WebsitePublicController@show'); } ); }