delete notification and notification_user when validate

This commit is contained in:
2025-12-16 10:11:08 +01:00
parent eab9565c7d
commit 8e93a0aba2
7 changed files with 51 additions and 9 deletions
+6 -1
View File
@@ -12,6 +12,11 @@ class Notification extends Model
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(User::class, 'notification_user', 'notification_id', 'user_id');
return $this->belongsToMany(
User::class,
'notification_user',
'notification_id',
'user_id'
)->withTimestamps();
}
}
+6 -1
View File
@@ -57,6 +57,11 @@ class User extends Authenticatable
public function notifications(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(Notification::class, 'notification_user', 'user_id', 'notification_id');
return $this->belongsToMany(
Notification::class,
'notification_user',
'user_id',
'notification_id'
)->withTimestamps();
}
}