I have an input looks like this.
{!! Form::text('inventory[0][amount]', null, ['class'=>'form-control']) !!}
{!! Form::text('inventory[0][expiry_date]', null, ['data-format'=>'D, dd MM yyyy', 'class'=>'form-control']) !!}
print_r( $_POST ) results
[inventory] => Array ( [0] => Array ( [amount] => 66 [expiry_date] => 2019/05/20 ) )
I am trying to check if the amount and the expiry_date are not null
if ( $input['inventory[0][amount]'] and $input['inventory[0][expiry_date]'] != null )
Got
Undefined index: inventory[0][amount]
$request->has('inventory[0][amount]')$input['inventory'][0]['amount']See the difference?