Fix Laravel Pint formatting
This commit is contained in:
@@ -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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user