model->where('key', $key)->first(); return $results ? $results->value : null; } public function updateOrCreateByKey(string $key, array $data = []) { return $this->model->updateOrCreate( [ 'key' => $key ], $data ); } }