2023-04-06 17:27:18 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Support;
|
|
|
|
|
|
|
|
use App\Models\Setting;
|
|
|
|
|
|
|
|
class Settings
|
|
|
|
{
|
|
|
|
private Setting $setting;
|
|
|
|
|
2023-04-06 17:42:15 -07:00
|
|
|
private function __construct()
|
2023-04-06 17:27:18 -07:00
|
|
|
{
|
|
|
|
$this->setting = Setting::factory()->create();
|
|
|
|
}
|
|
|
|
|
2023-04-06 17:42:15 -07:00
|
|
|
public static function initialize()
|
|
|
|
{
|
|
|
|
return new self();
|
|
|
|
}
|
|
|
|
|
2023-04-06 17:27:18 -07:00
|
|
|
public function enableMultipleFullCompanySupport()
|
|
|
|
{
|
|
|
|
$this->update(['full_multiple_companies_support' => 1]);
|
|
|
|
}
|
|
|
|
|
2023-04-06 17:48:23 -07:00
|
|
|
public function set(array $attributes)
|
|
|
|
{
|
|
|
|
$this->update($attributes);
|
|
|
|
}
|
|
|
|
|
2023-04-06 17:27:18 -07:00
|
|
|
private function update(array $attributes)
|
|
|
|
{
|
|
|
|
Setting::unguarded(fn() => $this->setting->update($attributes));
|
|
|
|
}
|
|
|
|
}
|