Laravel get request post array

Retrieving A Portion Of The Input Data If you need to retrieve a sub-set of the input data, you may use the only and except methods. Both of these methods will accept a single array or a dynamic list of arguments:

$input = $request->only(['username', 'password']);

$input = $request->only('username', 'password');

$input = $request->except(['credit_card']);

$input = $request->except('credit_card');

omit the quotes into the array brackets

<input name="order[amount]">
<input name="order[amount2]">

then you can get the value for example

return $request->input('order')['amount'];
return $request->input('order')['amount2'];

or

return $request->get('order')['amount'];
return $request->get('order')['amount2'];

Use dot notation:

$value = $request->input('order.return_url');