Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel get request post array

Im using Laravel 5 and Im trying to get a value from my posted form. This works fine for normal form input names, like:

$request->input('stripeToken')

However if the input name is a array like name="order['amount']"then I cant get the value. I've tried with:

$request->input( "order['return_url']" )

Anyone got any tips for this?

like image 586
Ole Haugset Avatar asked Nov 17 '15 15:11

Ole Haugset


1 Answers

Use dot notation:

$value = $request->input('order.return_url');
like image 112
Joseph Silber Avatar answered Oct 19 '22 22:10

Joseph Silber