How to get All input of POST in Laravel

后端 未结 8 891
不知归路
不知归路 2021-02-03 17:10

I am using Laravel 5 and trying to get all input of POST variable in controller like this-

public function add_question()
{
    return Request::all();
}
<         


        
8条回答
  •  无人及你
    2021-02-03 17:55

    You should use the facade rather than Illuminate\Http\Request. Import it at the top:

    use Request;
    

    And make sure it doesn't conflict with the other class.

    Edit: This answer was written a few years ago. I now favour the approach suggested by shuvrow below.

提交回复
热议问题