What is meant by Retrieving Input ?

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


Please Help Members By Posting Answers For Below Questions

Explain binding instances?

535


What is the use of dd() function?

523


How to register a middleware in laravel?

491


Explain how to create custom middleware in laravel?

522


Explain how to retrive all requested data in laravel?

502


How to do subdomain routing in laravel?

526


Explain laravel query builder?

528


How to get current route name?

505


What are the advantages of using laravel?

519


What is fillable in laravel model?

513


How to check composer is installed or not in laravel?

494


What is the best backend for react?

552


What is use in laravel?

525


Do you know laravel service container?

532


What is a controller middleware?

555