koel/app/Repositories/SettingRepository.php

21 lines
399 B
PHP
Raw Normal View History

2018-08-29 06:15:11 +00:00
<?php
namespace App\Repositories;
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
{
return $this->model->pluck('value', 'key')->toArray();
2018-08-29 06:15:11 +00:00
}
public function getByKey(string $key): mixed
{
return Setting::get($key);
}
2018-08-29 06:15:11 +00:00
}