fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
+7 -6
View File
@@ -2,7 +2,6 @@
namespace App\Models;
use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Cache;
@@ -17,6 +16,7 @@ class Setting extends BaseModel
'created_at',
'updated_at',
];
public $timestamps = true;
protected $casts = [
@@ -49,7 +49,7 @@ class Setting extends BaseModel
{
return static::query()->first() ?? static::query()->create([
// set safe defaults if you want
'name' => 'App',
'name' => 'App',
'timezone' => config('app.timezone', 'UTC'),
]);
}
@@ -70,6 +70,7 @@ class Setting extends BaseModel
public static function updateSettings(array $data): bool
{
$settings = static::singleton();
return $settings->fill($data)->save();
}
@@ -104,9 +105,9 @@ class Setting extends BaseModel
public static function rules(bool $updating = false): array
{
return [
'name' => ['nullable', 'string', 'max:255'],
'timezone' => ['nullable', 'string', 'max:80'], // validate against a list if you want
'updated_by'=> ['nullable', 'integer'],
'name' => ['nullable', 'string', 'max:255'],
'timezone' => ['nullable', 'string', 'max:80'], // validate against a list if you want
'updated_by' => ['nullable', 'integer'],
];
}
}
}