2018-08-29 06:15:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
2022-07-07 10:45:47 +00:00
|
|
|
use App\Models\Setting;
|
|
|
|
|
2024-04-24 21:58:19 +00:00
|
|
|
/** @extends Repository<Setting> */
|
2022-07-29 06:47:10 +00:00
|
|
|
class SettingRepository extends Repository
|
2018-08-29 06:15:11 +00:00
|
|
|
{
|
2020-12-22 20:11:22 +00:00
|
|
|
/** @return array<mixed> */
|
2018-08-29 06:15:11 +00:00
|
|
|
public function getAllAsKeyValueArray(): array
|
|
|
|
{
|
2022-07-07 21:23:41 +00:00
|
|
|
return $this->model->pluck('value', 'key')->toArray();
|
2018-08-29 06:15:11 +00:00
|
|
|
}
|
2022-07-07 10:45:47 +00:00
|
|
|
|
|
|
|
public function getByKey(string $key): mixed
|
|
|
|
{
|
|
|
|
return Setting::get($key);
|
|
|
|
}
|
2018-08-29 06:15:11 +00:00
|
|
|
}
|