Implement tenant announcements and audit log fixes
This commit is contained in:
39
app/Models/TenantAnnouncementDelivery.php
Normal file
39
app/Models/TenantAnnouncementDelivery.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\TenantAnnouncementDeliveryStatus;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class TenantAnnouncementDelivery extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'tenant_announcement_id',
|
||||
'tenant_id',
|
||||
'channel',
|
||||
'status',
|
||||
'sent_at',
|
||||
'failed_at',
|
||||
'failure_reason',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'status' => TenantAnnouncementDeliveryStatus::class,
|
||||
'sent_at' => 'datetime',
|
||||
'failed_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function announcement(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(TenantAnnouncement::class, 'tenant_announcement_id');
|
||||
}
|
||||
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tenant::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user