lasthourcloud/app/Models/InstanceSettings.php

30 lines
799 B
PHP
Raw Normal View History

2023-03-28 13:47:37 +00:00
<?php
namespace App\Models;
2023-06-06 15:50:13 +00:00
use App\Notifications\Channels\SendsEmail;
use Illuminate\Contracts\Database\Eloquent\Builder;
2023-03-28 13:47:37 +00:00
use Illuminate\Database\Eloquent\Model;
2023-06-06 15:50:13 +00:00
use Illuminate\Notifications\Notifiable;
use Spatie\SchemalessAttributes\Casts\SchemalessAttributes;
2023-03-28 13:47:37 +00:00
2023-06-06 15:50:13 +00:00
class InstanceSettings extends Model implements SendsEmail
2023-03-28 13:47:37 +00:00
{
use Notifiable;
2023-07-14 09:27:08 +00:00
protected $guarded = [];
2023-06-06 15:50:13 +00:00
protected $casts = [
2023-07-14 10:09:56 +00:00
'resale_license' => 'encrypted',
2023-06-06 15:50:13 +00:00
];
2023-07-28 08:55:26 +00:00
public function getRecepients($notification)
2023-06-06 15:50:13 +00:00
{
2023-07-28 08:55:26 +00:00
$recipients = data_get($notification,'emails',null);
2023-06-06 15:50:13 +00:00
if (is_null($recipients) || $recipients === '') {
return [];
}
return explode(',', $recipients);
}
2023-05-16 15:09:50 +00:00
public static function get()
{
return InstanceSettings::findOrFail(0);
}
}