fixed notification system and added a new tenant notifications receipt table to track read status and filter messages by scope.

This commit is contained in:
Codex Agent
2025-12-17 10:57:19 +01:00
parent 0aae494945
commit d64839ba2f
31 changed files with 1089 additions and 127 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class TenantNotificationReceipt extends Model
{
protected $fillable = [
'tenant_id',
'notification_log_id',
'user_id',
'recipient',
'status',
];
protected $casts = [
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
public function tenant()
{
return $this->belongsTo(Tenant::class);
}
public function notificationLog()
{
return $this->belongsTo(TenantNotificationLog::class, 'notification_log_id');
}
public function user()
{
return $this->belongsTo(User::class);
}
}