group(function () { Route::get('task/form/{element}', 'TaskAPIController@form'); Route::resource('task', 'TaskAPIController'); }); // Public routes for task Route::get('tasks/', 'TaskPublicController@index'); Route::get('tasks/{slug?}', 'TaskPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for tasks Route::prefix('{guard}/task')->group(function () { Route::get('task/form/{element}', 'TaskAPIController@form'); Route::apiResource('task', 'TaskAPIController'); }); // Public routes for tasks Route::get('task/Task', 'TaskPublicController@getTask'); } ); } // API routes for tasktype Route::prefix('{guard}/task')->group(function () { Route::get('tasktype/form/{element}', 'TasktypeAPIController@form'); Route::resource('tasktype', 'TasktypeAPIController'); }); // Public routes for tasktype Route::get('tasks/', 'TasktypePublicController@index'); Route::get('tasks/{slug?}', 'TasktypePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for tasks Route::prefix('{guard}/task')->group(function () { Route::get('tasktype/form/{element}', 'TasktypeAPIController@form'); Route::apiResource('tasktype', 'TasktypeAPIController'); }); // Public routes for tasks Route::get('task/Tasktype', 'TasktypePublicController@getTasktype'); } ); }