mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
init
This commit is contained in:
39
app/Models/NotificationChannel.php
Normal file
39
app/Models/NotificationChannel.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user