Files
SAE-BUT2-backend/app/Models/Notification.php
T
2026-03-13 15:30:54 +01:00

25 lines
479 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',
)
->withPivot('unread')
->withTimestamps();
}
}