Answer Posted / amit khanna
The input values can be easily retrieved in Laravel.
No matter what method was used “get” or “post”, the Laravel method will retrieve input values for both the methods the same way.
There are two ways we can retrieve the input values.
Using the input() method
Using the properties of Request instance
Using the input() method
The input() method takes one argument, the name of the field in form. For example, if the form contains username field then we can access it by the following way.
$name = $request->input('username');
Using the properties of Request instance
Like the input() method, we can get the username property directly from the request instance.
$request->username
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is system requirement for installation of laravel 5.2 (latest version)?
Is laravel easy?
What are the requirements to install valet?
How to localize resource uris in laravel?
What is a forget() ?
How to turn off crsf protection for specific route in laravel?
What is reverse path multicasting?
explain how to add a middleware in route group?
What are the Writing Gates and Policies ?
Explain the difference between laravel and codeigniter?
List available types of relationships in laravel eloquent.
What is x-csrf-token?
What is validation in laravel and how it is used?
What is Terminable Middleware ?
Is laravel faster than rails?