34 lines
672 B
PHP
34 lines
672 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NotificationChannel extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected $hidden = ['credentials'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'enabled' => 'boolean',
|
|
'is_default' => 'boolean',
|
|
'credentials' => 'encrypted:array',
|
|
'settings' => 'array',
|
|
'last_health_check_at' => 'datetime',
|
|
];
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function templates()
|
|
{
|
|
return $this->hasMany(NotificationTemplate::class);
|
|
}
|
|
}
|