src/Franzose/ClosureTable/Models/Entity.php
public function getLastChild(array $columns = ['*'])
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex())->last();
        } else {
            $result = $this->children(static::QUERY_LAST)->first($columns);
        }

        return $result;
    }
public function getLastChild(array $columns = ['*'])
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex())->last();
        } else {
            $result = $this->children(static::QUERY_LAST)->first($columns);
        }

        return $result;
    }
public function getLastChild ( array $ columns = [ '*' ] ) { if ( $ this -> hasChildrenRelation ( ) ) { $ result = $ this -> getRelation ( $ this -> getChildrenRelationIndex ( ) ) -> last ( ) ; } else { $ result = $ this -> children ( static :: QUERY_LAST ) -> first ( $ columns ) ; } return $ result ; }
Retrieves the last child.

@param array $columns
@return Entity
Retrieves the last child .