resolve conflits
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Notification extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'content',
|
||||
];
|
||||
|
||||
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'user_notification', 'notification_id', 'user_id');
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,9 @@ class User extends Authenticatable
|
||||
public function tasks() {
|
||||
return $this->belongsToMany(Task::class);
|
||||
}
|
||||
|
||||
public function notifications(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Notification::class, 'user_notification', 'user_id', 'notification_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user