2018-08-29 06:15:11 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
2022-07-07 10:45:47 +00:00
|
|
|
use App\Models\Setting;
|
|
|
|
|
2018-08-29 06:15:11 +00:00
|
|
|
class SettingRepository extends AbstractRepository
|
|
|
|
{
|
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
|
|
|
}
|