group(function () { Route::get('dealer/form/{element}', 'DealerAPIController@form'); Route::resource('dealer', 'DealerAPIController'); }); // Public routes for dealer Route::get('dealers/', 'DealerPublicController@index'); Route::get('dealers/{slug?}', 'DealerPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for dealers Route::prefix('{guard}/dealer')->group(function () { Route::get('dealer/form/{element}', 'DealerAPIController@form'); Route::apiResource('dealer', 'DealerAPIController'); }); // Public routes for dealers Route::get('dealer/Dealer', 'DealerPublicController@getDealer'); } ); }