Collection::last PHP Method

last() public method

Returns the last element from the array
public last ( ) : mixed
return mixed
    public function last()
    {
        $array = $this->data;
        return array_pop($array);
    }

Usage Example

 public function testMergeCollection()
 {
     $this->collection->merge(new Collection(['test']));
     $this->assertEquals(5, $this->collection->count());
     $this->assertEquals('test', $this->collection->last());
 }
All Usage Examples Of Collection::last