group(function () { Route::resource('listing', 'ListingResourceController'); }); 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', 'ListingResourceController'); }); // Public routes for pages Route::get('listings/', 'ListingPublicController@index'); Route::get('listings/{slug?}', 'ListingPublicController@show'); } ); } // web routes for company Route::prefix('{guard}/listing')->group(function () { Route::resource('company', 'CompanyResourceController'); }); 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', 'CompanyResourceController'); }); // Public routes for pages Route::get('listings/', 'CompanyPublicController@index'); Route::get('listings/{slug?}', 'CompanyPublicController@show'); } ); }