Laravel Request::all() Should Not Be Called Statically

前端 未结 9 1561
迷失自我
迷失自我 2020-11-28 20:53

In Laravel, I\'m trying to call $input = Request::all(); on a store() method in my controller, but I\'m getting the following error:

9条回答
  •  忘掉有多难
    2020-11-28 21:28

    also it happens when you import following library to api.php file. this happens by some IDE's suggestion to import it for not finding the Route Class.

    just remove it and everything going to work fine.

    use Illuminate\Routing\Route;
    

    update:

    seems if you add this library it wont lead to error

    use Illuminate\Support\Facades\Route;
    

提交回复
热议问题