Closed abanghendri closed 1 year ago
// Get the latest post.
$post = Post::latest()->first();
// Get the meta attributes as an array
$meta = $post->meta;
// Update the custom_value.
$meta['custom_value'] = 'somevalue';
// Update the meta attributes in the model.
$post->meta = $meta;
// Save the changes.
$post->save();
The record should now be updated:
{
"body": "My very first test post!",
"meta": {
"custom_key": "somevalue"
},
"title": "Test Post",
"created_at": "2023-08-16 10:00:59",
"updated_at": "2023-08-16 10:00:59"
}
Hello, I came here because I am working with ypur multitenancy package, it is really awesome package But, I need help to deal with nesting data e.g:
Or even deeper data , I cannot use
$tenant->update(['social->instagram' => 'newlink'])
So how to deal with it?