src/Model.php
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;
    }
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;
    }
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 ; }
Cache this value.

@param string $key
@param mixed  $value

@return mixed
Cache this value .