36 lines
755 B
PHP
36 lines
755 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NotificationBroadcast extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['filter_snapshot' => 'array', 'scheduled_at' => 'datetime'];
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function template()
|
|
{
|
|
return $this->belongsTo(NotificationTemplate::class, 'notification_template_id');
|
|
}
|
|
|
|
public function channelConfig()
|
|
{
|
|
return $this->belongsTo(NotificationChannel::class, 'notification_channel_id');
|
|
}
|
|
|
|
public function recipients()
|
|
{
|
|
return $this->hasMany(NotificationBroadcastRecipient::class);
|
|
}
|
|
}
|