koel/app/Repositories/SettingRepository.php
2022-07-07 12:45:47 +02:00

19 lines
367 B
PHP

<?php
namespace App\Repositories;
use App\Models\Setting;
class SettingRepository extends AbstractRepository
{
/** @return array<mixed> */
public function getAllAsKeyValueArray(): array
{
return $this->model->pluck('value', 'key')->all();
}
public function getByKey(string $key): mixed
{
return Setting::get($key);
}
}