group(function () { Route::get('deal/form/{element}', 'DealAPIController@form'); Route::resource('deal', 'DealAPIController'); }); // Public routes for deal Route::get('services/', 'DealPublicController@index'); Route::get('services/{slug?}', 'DealPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for services Route::prefix('{guard}/service')->group(function () { Route::get('deal/form/{element}', 'DealAPIController@form'); Route::apiResource('deal', 'DealAPIController'); }); // Public routes for services Route::get('service/Deal', 'DealPublicController@getDeal'); } ); } // API routes for service Route::prefix('{guard}/service')->group(function () { Route::get('service/form/{element}', 'ServiceAPIController@form'); Route::resource('service', 'ServiceAPIController'); }); // Public routes for service Route::get('services/', 'ServicePublicController@index'); Route::get('services/{slug?}', 'ServicePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for services Route::prefix('{guard}/service')->group(function () { Route::get('service/form/{element}', 'ServiceAPIController@form'); Route::apiResource('service', 'ServiceAPIController'); }); // Public routes for services Route::get('service/Service', 'ServicePublicController@getService'); } ); }