<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SiteSetting extends Model
{
    use HasFactory;

    protected $guarded = [];

    public static function getValue($key, $default = null)
    {
        $setting = static::query()->where('id', 1)->first();

        return $setting->{$key} ?? $default;
    }
}
