protected function cache($key, $value)
    {
        if (array_has($this->model_cache, $key)) {
            return array_get($this->model_cache, $key);
        }

        if (is_callable($value)) {
            $result = $value();
        } else {
            $result = $value;
        }

        array_set($this->model_cache, $key, $result);

        return $result;
    }