Database Notifications UUIDv7 #57810
-
|
Does Laravel’s Database Notifications However, when I try to update the value inside the The But when I disable Why is it only possible to update the data when using UUID v4? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Laravel’s notification system does not require UUID v4, and UUID v7 works perfectly. fix option 01: Use $fillable instead of $guarded option 02: |
Beta Was this translation helpful? Give feedback.
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'),
]);
});