group(function () { Route::get('car/form/{element}', 'CarAPIController@form'); Route::resource('car', 'CarAPIController'); }); // Public routes for car Route::get('cars/', 'CarPublicController@index'); Route::get('cars/{slug?}', 'CarPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for cars Route::prefix('{guard}/car')->group(function () { Route::get('car/form/{element}', 'CarAPIController@form'); Route::apiResource('car', 'CarAPIController'); }); // Public routes for cars Route::get('car/Car', 'CarPublicController@getCar'); } ); } // API routes for brand Route::prefix('{guard}/car')->group(function () { Route::get('brand/form/{element}', 'BrandAPIController@form'); Route::resource('brand', 'BrandAPIController'); }); // Public routes for brand Route::get('cars/', 'BrandPublicController@index'); Route::get('cars/{slug?}', 'BrandPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for cars Route::prefix('{guard}/car')->group(function () { Route::get('brand/form/{element}', 'BrandAPIController@form'); Route::apiResource('brand', 'BrandAPIController'); }); // Public routes for cars Route::get('car/Brand', 'BrandPublicController@getBrand'); } ); } // API routes for car_model Route::prefix('{guard}/car')->group(function () { Route::get('car_model/form/{element}', 'CarModelAPIController@form'); Route::resource('car_model', 'CarModelAPIController'); }); // Public routes for car_model Route::get('cars/', 'CarModelPublicController@index'); Route::get('cars/{slug?}', 'CarModelPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for cars Route::prefix('{guard}/car')->group(function () { Route::get('car_model/form/{element}', 'CarModelAPIController@form'); Route::apiResource('car_model', 'CarModelAPIController'); }); // Public routes for cars Route::get('car/CarModel', 'CarModelPublicController@getCarModel'); } ); }