forked from admin/services_core
31 lines
617 B
PHP
31 lines
617 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NotificationTemplate extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['enabled' => 'boolean', 'variables' => 'array'];
|
|
}
|
|
|
|
public function event()
|
|
{
|
|
return $this->belongsTo(NotificationEvent::class, 'notification_event_id');
|
|
}
|
|
|
|
public function channelConfig()
|
|
{
|
|
return $this->belongsTo(NotificationChannel::class, 'notification_channel_id');
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
}
|