koel/app/Repositories/SettingRepository.php

20 lines
371 B
PHP
Raw Normal View History

2018-08-29 06:15:11 +00:00
<?php
namespace App\Repositories;
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
{
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
}