예제 #1
0
 /**
  * Get the last item from the collection.
  *
  * @param  callable|null $callback
  * @param  mixed         $default
  *
  * @return mixed
  */
 public function last(callable $callback = NULL, $default = NULL)
 {
     if (NULL === $callback) {
         return count($this->items) > 0 ? end($this->items) : value($default);
     }
     return Lib::array_last($this->items, $callback, $default);
 }