0
我有一个会话变量,其中包含各种json
对象,我希望能够更新这些对象。Laravel 5.4更新数组中的值
例如,
$userIndex = 123;
session()->get('app.users')[$userIndex]['phones']['landline'];
session()->get('app.users')[$userIndex]['phones']['mobile'];
如何更新内容的价值?我如何会话put
一个新的手机号码?
session()->get('app.users')[$userIndex]['phones']['mobile'] = '12345678';
'会话() - >替换( 'app.users')[$ userIndex] [ '电话'] [ '移动'] = '12345678';' – Gunaseelan