1.0.4 - fix instal.php
This commit is contained in:
+15
-18
@@ -1,31 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AppSetting extends Model
|
||||
{
|
||||
protected $table = 'app_settings';
|
||||
|
||||
protected $fillable = [
|
||||
'logo',
|
||||
'logo_small',
|
||||
'logo_path',
|
||||
'logo_small_path',
|
||||
'nome_applicazione',
|
||||
'nome_organizzazione',
|
||||
'footer_text',
|
||||
'app_version',
|
||||
'dashboard_welcome',
|
||||
'show_version',
|
||||
'backup_path',
|
||||
'backup_retention_days',
|
||||
'backup_include_files',
|
||||
'backup_include_env',
|
||||
'backup_auto_enabled',
|
||||
'backup_auto_frequency',
|
||||
'backup_auto_hour',
|
||||
'logo', 'logo_small', 'logo_path', 'logo_small_path',
|
||||
'nome_applicazione', 'nome_organizzazione',
|
||||
'footer_text', 'app_version', 'dashboard_welcome', 'show_version',
|
||||
'backup_path', 'backup_retention_days', 'backup_include_files',
|
||||
'backup_include_env', 'backup_auto_enabled', 'backup_auto_frequency', 'backup_auto_hour',
|
||||
'documenti_storage_disk', 'documenti_storage_path',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
@@ -36,11 +28,16 @@ class AppSetting extends Model
|
||||
'backup_include_env' => 'boolean',
|
||||
'backup_auto_enabled' => 'boolean',
|
||||
'backup_auto_hour' => 'integer',
|
||||
'show_version' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public static function getSetting(string $key, $default = null)
|
||||
public static function getSetting(string $key, mixed $default = null): mixed
|
||||
{
|
||||
if (!Schema::hasTable('app_settings')) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
$setting = self::first();
|
||||
return $setting?->{$key} ?? $default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user