我在My laravel应用程序中有三个这样的TaskController函数方法,
public function show($project_id,$task_id)
{
$project = Project::find($project_id);
$task = Task::find($task_id);
view('tasks.show')->withProject($project)->withFiles($files)->withTask($task);
return view('tasks.show', ['task' => $task, 'project' => $project]);
}
public function show1($project_id,$task_id)
{
$project = Project::find($project_id);
$task = Task::find($task_id);
view('tasks.show')->withProject($project)->withFiles($files)->withTask($task);
return view('tasks.show1', ['task' => $task, 'project' => $project]);
}
public function show2($project_id,$task_id)
{
$project = Project::find($project_id);
$task = Task::find($task_id);
view('tasks.show')->withProject($project)->withFiles($files)->withTask($task);
return view('tasks.show2', ['task' => $task, 'project' => $project]);
}
我的路线是这样的,
Route::get('projects/{projects}/tasks/{tasks}',[
'uses' => '\App\Http\Controllers\TasksController@show',
]);
Route::get('collaborators/projects/{projects}/tasks/{tasks}', [
'uses' => '\App\Http\Controllers\TasksController@show1',
]);
Route::get('collaborators/projects/{projects}/tasks/{tasks}', [
'uses' => '\App\Http\Controllers\TasksController@show2',
]);
但在以上三条路线中 show1 路线无效。但如果我删除 show2 路由,那么show1正在运行。我该如何解决这个问题?