group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::resource('favorite', 'FavoriteAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for favorites Route::prefix('{guard}/favorite')->group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::apiResource('favorite', 'FavoriteAPIController'); }); // Public routes for favorites Route::get('favorite/Favorite', 'FavoritePublicController@getFavorite'); } ); }