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();
}
<
For those who came here looking for "how to get All input of POST" only
class Illuminate\Http\Request
extends from Symfony\Component\HttpFoundation\Request
which has two class variables that store request parameters.
public $query
- for GET parameters
public $request
- for POST parameters
Usage: To get a post data only
$request = Request::instance();
$request->request->all(); //Get all post requests
$request->request->get('my_param'); //Get a post parameter
Source here
EDIT
For Laravel >= 5.5, you can simply call $request->post()
or $request->post('my_param')
which internally calls $request->request->all()
or $request->request->get('my_param')
respectively.