Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

request input vs request get

What's the difference between:

$request->input('edit_biller_id');

and

$request->get('edit_biller_id');
0 likes
4 replies
dirksamson's avatar

The recommended usage is ->input() as it is a little bit more powerfull because it can parse nested data more fluently. The current docblock of the get() function even mentions: "This method belongs to Symfony HttpFoundation and is not usually needed when using Laravel. Instead, you may use the "input" method."

martinbean's avatar

I personally use input for fetching POST data and query for fetching query string values.

Snapey's avatar

old thread

input also

a) allows a default value to be provided if missing from the form

b) allows inputs that contain a hypen, which you cannot do with $request magic method,

eg $request->input('sub-total') instead of the invalid $request->sub-total

Please or to participate in this conversation.