Level 51
Lumen doesn't support Route Model Binding.
If you want to add support, there is a 3rd party package you can try:
1 like
the error is
Argument 1 passed to App\Http\Controllers\PostsController::show() must be an instance of App\Post, string given
in PostsController.php line 10
at PostsController->show('2')
web.php is
$router->get('posts/{post}/show','PostsController@show');
PostsController is
public function show(Post $post)
{
return $post;
}
i know it is simple automatic resolution but i dont know what is the problem here
Lumen doesn't support Route Model Binding.
If you want to add support, there is a 3rd party package you can try:
Please or to participate in this conversation.