public function first(?string $key = null)
    {
        $value = $this->get($key);

        if (is_array($value)) {
            return reset($value);
        }

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

        if (is_array($value)) {
            return reset($value);
        }

        return $value;
    }
public function first ( ? string $ key = null ) { $ value = $ this -> get ( $ key ) ; if ( is_array ( $ value ) ) { return reset ( $ value ) ; } return $ value ; }
Gets first element.

@param string|null $key

@return mixed
Gets first element .