ahmednawazkhan's avatar

Automatic resolution error in laravel lumen

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

0 likes
2 replies

Please or to participate in this conversation.