koel/app/Repositories/SettingRepository.php

20 lines
363 B
PHP
Raw Normal View History

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