src/Webpage/Traits/HasContent.php
public function withFeatured(int $count = 1)
    {
        if (!$items = $this->get('items')) {
            $this->append('featured', []);

            return $this;
        }

        $featured = $items->shift();

        $this->content['items'] = $items;
        $this->append('featured', [$featured]);

        return $this;
    }
public function withFeatured(int $count = 1)
    {
        if (!$items = $this->get('items')) {
            $this->append('featured', []);

            return $this;
        }

        $featured = $items->shift();

        $this->content['items'] = $items;
        $this->append('featured', [$featured]);

        return $this;
    }
public function withFeatured ( int $ count = 1 ) { if ( ! $ items = $ this -> get ( 'items' ) ) { $ this -> append ( 'featured' , [ ] ) ; return $ this ; } $ featured = $ items -> shift ( ) ; $ this -> content [ 'items' ] = $ items ; $ this -> append ( 'featured' , [ $ featured ] ) ; return $ this ; }
Moves the first X elements into a separate collection item

@param int $count
@return Model
Moves the first X elements into a separate collection item