Skip to content
Discussion options

You must be logged in to vote

Laravel’s notification system does not require UUID v4, and UUID v7 works perfectly.
Your issue is caused by guarding the id column (protected $guarded = ['id']), which interferes with updates on a JSON column using the data->key syntax.
It’s not related to the UUID version at all.

fix option 01:

Use $fillable instead of $guarded
protected $fillable = ['data'];

option 02:
Notification::unguarded(function () {
Notification::where('type', 'progress')->first()->update([
'data->finished_at' => now()->toIso8601ZuluString('microsecond'),
]);
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bayukartiko
Comment options

Answer selected by bayukartiko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants