add tests batch 20
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
@@ -16,7 +17,6 @@ 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,7 +70,6 @@ class Setting extends BaseModel
|
||||
public static function updateSettings(array $data): bool
|
||||
{
|
||||
$settings = static::singleton();
|
||||
|
||||
return $settings->fill($data)->save();
|
||||
}
|
||||
|
||||
@@ -105,9 +104,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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user