Laravel5 `RouteServiceProvider` `should be compatible with` Error

前端 未结 3 1520
挽巷
挽巷 2021-01-06 03:21

I am developing a web application by Laravel5, and in code of Controller, I wrote a code bellow.

public function show($id)
{
    $post = Post::find($id);
            


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-06 03:52

    You should try like:

    Please put use Route; instead of use App\Providers\Router; and try

    Or you can also use the app('router')->pattern().

    For more details please follow this link.

提交回复
热议问题