问题
This error has blocked me way forward. Does anyone have a solution to the Missing required parameters error? I have a very simple CRUD setup which throws this error in the Controller 'edit' method. This happens when the request is forwarded to the edit view.
Error:
```Facade\Ignition\Exceptions\ViewException
Missing required parameters for [Route: projects.edit] [URI:
projects/{project}/edit]. (View:
T:\estie\resources\views\frontend\layouts\homeapp.blade.php)```
Route definition is:
```Route::resource('projects','ProjectsController');```
Controller Edit method:
```public function edit(Project $project)
{
return view('projects.edit') ->with('project',$project);
}```
This is part of my index.blade.php which extends homeapp.blade.php:
<td align="center">
<a href="{{ route('projects.edit', ['project' => $project]) }}">EDIT</a>
</td>
Appreciate any help, please.
回答1:
This error is thrown when you try to get the URL of a route using the route
function without providing a required parameter.
Look for the route('projects.edit')
call in your homeapp.blade.php
and add the project as a parameter: route('projects.edit', ['project' => $project])
来源:https://stackoverflow.com/questions/61028370/missing-required-parameters-for-route-projects-edit-uri-projects-project