Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
systemson committed Apr 8, 2019
1 parent 50e9101 commit 6726ef1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Base/BaseCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ public function find(string $key)
*/
public function first()
{
return $this->find($this->keys()[0]);
if ($this->isNotEmpty()) {
return $this->find($this->keys()[0]);
}
}

/**
Expand All @@ -185,7 +187,9 @@ public function first()
*/
public function last()
{
return $this->find($this->keys()[$this->count() - 1]);
if ($this->isNotEmpty()) {
return $this->find($this->keys()[$this->count() - 1]);
}
}

/**
Expand Down

0 comments on commit 6726ef1

Please sign in to comment.