group(function () { Route::get('listing/form/{element}', 'ListingAPIController@form'); Route::resource('listing', 'ListingAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for listings Route::prefix('{guard}/listing')->group(function () { Route::get('listing/form/{element}', 'ListingAPIController@form'); Route::apiResource('listing', 'ListingAPIController'); }); // Public routes for listings Route::get('listing/Listing', 'ListingPublicController@getListing'); } ); } // API routes for company Route::prefix('{guard}/listing')->group(function () { Route::get('company/form/{element}', 'CompanyAPIController@form'); Route::resource('company', 'CompanyAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for listings Route::prefix('{guard}/listing')->group(function () { Route::get('company/form/{element}', 'CompanyAPIController@form'); Route::apiResource('company', 'CompanyAPIController'); }); // Public routes for listings Route::get('listing/Company', 'CompanyPublicController@getCompany'); } ); }