public function first() : ?Post
    {
        $params = array_merge($this->getParameters(), [
            'limit' => 1,
        ]);

        $posts = Timber::get_posts($params, $this->postClass);

        if (!is_array($posts)) {
            return null;
        }

        return collect($posts)->first();
    }
public function first() : ?Post
    {
        $params = array_merge($this->getParameters(), [
            'limit' => 1,
        ]);

        $posts = Timber::get_posts($params, $this->postClass);

        if (!is_array($posts)) {
            return null;
        }

        return collect($posts)->first();
    }
public function first ( ) : ? Post { $ params = array_merge ( $ this -> getParameters ( ) , [ 'limit' => 1 , ] ) ; $ posts = Timber :: get_posts ( $ params , $ this -> postClass ) ; if ( ! is_array ( $ posts ) ) { return null ; } return collect ( $ posts ) -> first ( ) ; }
Get the first Post that matches the current query. If no Post matches then return `null`.

@return Rareloop\Lumberjack\Post|null
Get the first Post that matches the current query . If no Post matches then return null .