mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 19:40:53 +08:00
Initial commit
This commit is contained in:
18
app/Services/SettingService.php
Normal file
18
app/Services/SettingService.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Setting as SettingModel;
|
||||
|
||||
class SettingService
|
||||
{
|
||||
public function get($name, $default = null)
|
||||
{
|
||||
$setting = SettingModel::where('name', $name)->first();
|
||||
return $setting ? $setting->value : $default;
|
||||
}
|
||||
|
||||
public function getAll(){
|
||||
return SettingModel::all()->pluck('value', 'name')->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user