src/Collection.php
public function last()
    {
        if (is_array($this->items) && count($this->items) > 0) {
            return end($this->items);
        }
        return null;
    }
public function last()
    {
        if (is_array($this->items) && count($this->items) > 0) {
            return end($this->items);
        }
        return null;
    }
public function last ( ) { if ( is_array ( $ this -> items ) && count ( $ this -> items ) > 0 ) { return end ( $ this -> items ) ; } return null ; }
Get last element in collection.

@return mixed|null
Get last element in collection .