group(function () { Route::get('forms/form/{element}', 'FormsAPIController@form'); Route::resource('forms', 'FormsAPIController'); }); // Public routes for forms Route::get('forms/', 'FormsPublicController@index'); Route::get('forms/{slug?}', 'FormsPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for forms Route::prefix('{guard}/form')->group(function () { Route::get('forms/form/{element}', 'FormsAPIController@form'); Route::apiResource('forms', 'FormsAPIController'); }); // Public routes for forms Route::get('form/Forms', 'FormsPublicController@getForms'); } ); } // API routes for user Route::prefix('{guard}/form')->group(function () { Route::get('user/form/{element}', 'UserAPIController@form'); Route::resource('user', 'UserAPIController'); }); // Public routes for user Route::get('forms/', 'UserPublicController@index'); Route::get('forms/{slug?}', 'UserPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for forms Route::prefix('{guard}/form')->group(function () { Route::get('user/form/{element}', 'UserAPIController@form'); Route::apiResource('user', 'UserAPIController'); }); // Public routes for forms Route::get('form/User', 'UserPublicController@getUser'); } ); }