mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 01:04:03 +00:00
Finalize Typescript restructure
This commit is contained in:
@@ -2,19 +2,14 @@
|
||||
|
||||
namespace App\Services\Backup;
|
||||
|
||||
use App\Models\CompanySetting;
|
||||
use App\Models\FileDisk;
|
||||
use Exception;
|
||||
use Spatie\Backup\Config\Config;
|
||||
|
||||
class BackupConfigurationFactory
|
||||
{
|
||||
public static function make($data = []): Config
|
||||
public static function make(array $data = []): Config
|
||||
{
|
||||
if (blank($data['company'] ?? null)) {
|
||||
throw new Exception('The Company ID is missig');
|
||||
}
|
||||
|
||||
if (blank($data['file_disk_id'] ?? null)) {
|
||||
throw new Exception('No file disk selected');
|
||||
}
|
||||
@@ -27,12 +22,6 @@ class BackupConfigurationFactory
|
||||
|
||||
config(['backup.backup.destination.disks' => [$prefix.$fileDisk->driver]]);
|
||||
|
||||
$companyNotificationEmail = CompanySetting::getSetting('notification_email', $data['company']);
|
||||
|
||||
if ($companyNotificationEmail) {
|
||||
config(['backup.notifications.mail.to' => $companyNotificationEmail]);
|
||||
}
|
||||
|
||||
$config = Config::fromArray(config('backup'));
|
||||
|
||||
return $config;
|
||||
|
||||
Reference in New Issue
Block a user