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

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

    I was facing this problem even with use Illuminate\Http\Request; line at the top of my controller. Kept pulling my hair till I realized that I was doing $request::ip() instead of $request->ip(). Can happen to you if you didn't sleep all night and are looking at the code at 6am with half-opened eyes.

    Hope this helps someone down the road.

提交回复
热议问题