Answer the question
In order to leave comments, you need to log in
Difference of 2 entries $request->input and $request->get('input') if the results are the same?
Laravel 5.3, what's the difference if the result is the same?
The second option is longer, more visual load, and it's kind of like an additional method on the collection, which means additional operation execution time.
Answer the question
In order to leave comments, you need to log in
$request->get('input')
- a direct legacy from SymfonyRequest$request->input
- already implemented in Laravel with the help of magic ( __get('input') ) and has a different implementation independent of $request->get()
. $request->get('input')
and $request->input
may return different results under certain conditions. The second option will return the value where the first one returns null
, but a little "slower".
You can see the implementation of each of them on GitHub:
SymfonyRequest::get()
Request::__get()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question