delete notification and notification_user when validate
This commit is contained in:
@@ -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
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user