I've recently used array notation when naming html input fields. e.g.
<input type="text" name="user[$userId][licenseStatus]">
I've never used this syntax before and although it is extremely handy I cannot see a good way to access the data held in session from the view when using Laravel.
For instance I might want to retrieve the old data back into the input like this when say a validation failure occurs:
<input type="text" name="user[$userId][licenseStatus]" value="{{session()->getOldInput(user[$userId][licenseStatus], '')}}">
But this obviously doesn't work because the array syntax on the name field means the data is held in an array in session like this:
[
_old_input => user[
32=>licenseStatus = 'xyx',
12=>licenseStatus = 'xyz'
]
]
So is there a smart way to retrieve old input values?
Thanks,