mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 02:11:36 +00:00
40 lines
800 B
PHP
40 lines
800 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
/**
|
|
* @property string $provider
|
|
* @property string $label
|
|
* @property array $data
|
|
* @property bool $connected
|
|
* @property bool $is_default
|
|
* @property User $user
|
|
*/
|
|
class NotificationChannel extends AbstractModel
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'provider',
|
|
'label',
|
|
'data',
|
|
'connected',
|
|
'is_default',
|
|
];
|
|
|
|
protected $casts = [
|
|
'data' => 'json',
|
|
'connected' => 'boolean',
|
|
'is_default' => 'boolean',
|
|
];
|
|
|
|
public function provider(): \App\Contracts\NotificationChannel
|
|
{
|
|
$provider = config('core.notification_channels_providers_class')[$this->provider];
|
|
|
|
return new $provider($this);
|
|
}
|
|
}
|