Files
Mimic/app/Models/Config.php
T
2026-02-18 19:27:33 +00:00

23 lines
452 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Config extends Model
{
protected $fillable = ['key', 'value'];
public static function get($key, $default = null)
{
$config = self::where('key', $key)->first();
return $config ? $config->value : $default;
}
public static function set($key, $value)
{
return self::updateOrCreate(['key' => $key], ['value' => $value]);
}
}