Laravel Requests: Retrieving Input
Retrieving All Input Data
Retrieving An Input Value
Using a few simple methods, you may access all of the user input from your Illuminate\Http\Request instance without worrying about which HTTP verb was used for the request.
Value will be returned if the requested input value is not present on the request.
Retrieving Input From The Query String
You may call the query method without any arguments in order to retrieve all of the query string values as an associative array.
Retrieving Input Via Dynamic Properties
Retrieving JSON Input Values
Retrieving A Portion Of The Input Data
$input = $request->only(['username', 'password']);
$input = $request->only('username', 'password');
$input = $request->except(['credit_card']);
$input = $request->except('credit_card');
If you need to retrieve a subset of the input data, you may use the only and except methods.
Determining If An Input Value Is Present
Old Input
Cookies
All cookies created by the Laravel framework are encrypted and signed with an authentication code, meaning they will be considered invalid if they have been changed by the client.
Files
Related concepts
- Retrieving Input: Retrieving All Input Data
- Retrieving Input: Retrieving An Input Value
- Retrieving Input: Retrieving Input From The Query String
- Retrieving Input: Retrieving Input Via Dynamic Properties
- Retrieving Input: Retrieving JSON Input Values
- Retrieving Input: Retrieving A Portion Of The Input Data
- Retrieving Input: Determining If An Input Value Is Present
- Retrieving Input: Old Input
- Retrieving Input: Cookies
- Retrieving Input: Files