26 lines
501 B
PHP
26 lines
501 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Notification extends Model
|
|
{
|
|
protected $fillable = [
|
|
'content',
|
|
'user_id',
|
|
];
|
|
|
|
public function users(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
|
{
|
|
return $this->belongsToMany(
|
|
User::class,
|
|
'notification_user',
|
|
'notification_id',
|
|
'user_id'
|
|
)
|
|
->withPivot('unread')
|
|
->withTimestamps();
|
|
}
|
|
}
|