coolify/app/Models/InstanceSettings.php
2023-08-31 13:10:39 +02:00

33 lines
733 B
PHP

<?php
namespace App\Models;
use App\Notifications\Channels\SendsEmail;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class InstanceSettings extends Model implements SendsEmail
{
use Notifiable;
protected $guarded = [];
protected $casts = [
'resale_license' => 'encrypted',
'smtp_password' => 'encrypted',
];
public static function get()
{
return InstanceSettings::findOrFail(0);
}
public function getRecepients($notification)
{
$recipients = data_get($notification, 'emails', null);
if (is_null($recipients) || $recipients === '') {
return [];
}
return explode(',', $recipients);
}
}