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

前端 未结 9 1558
迷失自我
迷失自我 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:17

    use the request() helper instead. You don't have to worry about use statements and thus this sort of problem wont happen again.

    $input = request()->all();
    

    simple

提交回复
热议问题