group(function () { Route::resource('car', 'CarResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'CarResourceController'); }); // Public routes for pages Route::get('cars/', 'CarPublicController@index'); Route::get('cars/{slug?}', 'CarPublicController@show'); } ); } // web routes for brand Route::prefix('{guard}/car')->group(function () { Route::resource('brand', 'BrandResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'BrandResourceController'); }); // Public routes for pages Route::get('cars/', 'BrandPublicController@index'); Route::get('cars/{slug?}', 'BrandPublicController@show'); } ); } // web routes for car_model Route::prefix('{guard}/car')->group(function () { Route::resource('car_model', 'CarModelResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'CarModelResourceController'); }); // Public routes for pages Route::get('cars/', 'CarModelPublicController@index'); Route::get('cars/{slug?}', 'CarModelPublicController@show'); } ); }