Reputation: 65
I'm trying to set nested array in sessions using laravel methods.
So i need to get something like this
$_SESSION['order'][$productId] = array();
Is it possible to do with laravel built-in methods?
Upvotes: 2
Views: 763
Reputation: 2029
There is a little dirty way of achieving this:
$sessionData = Session->get('parentKey')
Than do some processing of data and add nested data to it, then do:
Session->put('parentKey', $sessionData)
I hope it is helpful for you.
Upvotes: 1