group(function () { Route::resource('preference', 'PreferenceResourceController'); }); // Public routes for preference Route::get('preferences/', 'PreferencePublicController@index'); Route::get('preference/{slug?}', 'PreferencePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for preference Route::prefix('{guard}/preference')->group(function () { Route::resource('preference', 'PreferenceResourceController'); }); // Public routes for preference Route::get('preferences/', 'PreferencePublicController@index'); Route::get('preference/{slug?}', 'PreferencePublicController@show'); } ); }