I am using laravel
5.6. I want to create a project and add tasks of project. I write the following code for routing a file.
Route::resource('project/{pid}/tasks','TaskController');
If I write a static URL like example.com/project/1/tasks
I am getting the task list of project 1. On project list page, I used the following code:
$pid=$project->id;
<a href="{{ route('project/{$pid}/tasks') }}" class="btn btn-primary btn-xs"><i class="fa fa-tasks"></i> Tasks </a>
but It is showing a routing error. How to get project id on task controller?