code: public function last()
      {
          if (is_array($this->items) && count($this->items) > 0) {
              return end($this->items);
          }
          return null;
      }
docs: Get last element in collection.
  
  @return mixed|null