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