Reputation: 136
can anybody help me with this error? Here my complete route
Route::resource('/blog/post', 'Backend\BlogController');
this is my edit function on BlogController
public function edit($id)
{
$post = Post::findOrFail($id);
return view("backend.blog.edit", compact('post'));
}
and this my button
<a href="{{ route('post.edit', $post->id) }}" class="btn btn-xs btn-default">
<i class="fa fa-edit"></i>
</a>
Upvotes: 1
Views: 230
Reputation: 8017
While generating a button, a correct way, according to the documentation is:
<a href="{{ route('post.edit', ['id' => $post->id]) }}" class="btn btn-xs btn-default">
<i class="fa fa-edit"></i>
</a>
Note passing an array of options as a second argument.
Upvotes: 1