src/DataStore.php
public function first(string $key)
    {
        $key = $this->getKey($key);

        if (!$this->exists($key)) {
            throw new ModelNotFoundException(sprintf('No query results for the redis key [%s]', $key));
        }

        $value = cache($key);

        if (is_array($value)) {
            return Arr::first($value);
        }

        return $value;
    }
public function first(string $key)
    {
        $key = $this->getKey($key);

        if (!$this->exists($key)) {
            throw new ModelNotFoundException(sprintf('No query results for the redis key [%s]', $key));
        }

        $value = cache($key);

        if (is_array($value)) {
            return Arr::first($value);
        }

        return $value;
    }
public function first ( string $ key ) { $ key = $ this -> getKey ( $ key ) ; if ( ! $ this -> exists ( $ key ) ) { throw new ModelNotFoundException ( sprintf ( 'No query results for the redis key [%s]' , $ key ) ) ; } $ value = cache ( $ key ) ; if ( is_array ( $ value ) ) { return Arr :: first ( $ value ) ; } return $ value ; }
Grab the first bit of data of whatever is saved to the key.
@param string $key
@return mixed|null
Grab the first bit of data of whatever is saved to the key .