group(function () { Route::resource('opportunities', 'OpportunitiesResourceController'); }); 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', 'OpportunitiesResourceController'); }); // Public routes for pages Route::get('opportunities/', 'OpportunitiesPublicController@index'); Route::get('opportunities/{slug?}', 'OpportunitiesPublicController@show'); } ); } // web routes for offers Route::prefix('{guard}/opportunity')->group(function () { Route::resource('offers', 'OffersResourceController'); }); 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', 'OffersResourceController'); }); // Public routes for pages Route::get('opportunities/', 'OffersPublicController@index'); Route::get('opportunities/{slug?}', 'OffersPublicController@show'); } ); }