where('key', $key)->first(); return $config?->value ?? $default; } public function getNested(string $key, string $path, mixed $default = null): mixed { $value = $this->get($key); return Arr::get($value ?? [], $path, $default); } public function set(string $key, mixed $value, ?string $description = null): Config { return Config::query()->updateOrCreate( ['key' => $key], [ 'value' => $value, 'description' => $description, ] ); } public function setNested(string $key, string $path, mixed $value, ?string $description = null): Config { $payload = $this->get($key, []); Arr::set($payload, $path, $value); return $this->set($key, $payload, $description); } }