为什么在JSON列中保存到Mysql时,键的顺序会更改? 这是创建用户时按键的顺序:
$user->emailNotifications()->create([
'settings' =>
[
"orders" => [
"paid" => false,
"snipped" => false,
],
"store_actions" => [
"added" => false,
"deleted" => false,
"transferred_license" => false,
],
"billing" => [
"changed_cycle" => false,
"failed_payment" => false,
],
"products" => [
"deactivated" => false,
],
],
]);
但以不同的顺序存储在数据库中:
"orders": {
"paid": true,
"snipped": true
},
"billing": {
"changed_cycle": false,
"failed_payment": false
},
"products": {
"deactivated": false
},
"store_actions": {
"added": false,
"deleted": false,
"transferred_license": false
}
可能是什么问题?