vito/app/Models/NotificationChannel.php
Saeed Vaziry 5c72f12490 init
2023-07-02 12:47:50 +02:00

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);
}
}