Level 7
You can do something like this
$order = Session::get('order');
$order['newone'] = 'look I added a new key';
Session::put('order', $order);
Summer Sale! All accounts are 50% off this week.
So my session stores an array
dd(Session::get('order) );
array (size=17)
'APIKey' => string 'xxxxx' (length=36)
'SiteID' => string 'xxxx' (length=36)
'UserID' => string 'xxxxx' (length=36)
I want to add another key/value pair to this session
array (size=17)
'APIKey' => string 'xxxxx' (length=36)
'SiteID' => string 'xxxx' (length=36)
'UserID' => string 'xxxxx' (length=36)
'newone' => string 'look I added a new key' (length=36)
You can do something like this
$order = Session::get('order');
$order['newone'] = 'look I added a new key';
Session::put('order', $order);
Please or to participate in this conversation.