group(function () { Route::get('opportunities/form/{element}', 'OpportunitiesAPIController@form'); Route::resource('opportunities', 'OpportunitiesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for opportunities Route::prefix('{guard}/opportunity')->group(function () { Route::get('opportunities/form/{element}', 'OpportunitiesAPIController@form'); Route::apiResource('opportunities', 'OpportunitiesAPIController'); }); // Public routes for opportunities Route::get('opportunity/Opportunities', 'OpportunitiesPublicController@getOpportunities'); } ); } // API routes for offers Route::prefix('{guard}/opportunity')->group(function () { Route::get('offers/form/{element}', 'OffersAPIController@form'); Route::resource('offers', 'OffersAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for opportunities Route::prefix('{guard}/opportunity')->group(function () { Route::get('offers/form/{element}', 'OffersAPIController@form'); Route::apiResource('offers', 'OffersAPIController'); }); // Public routes for opportunities Route::get('opportunity/Offers', 'OffersPublicController@getOffers'); } ); }