/** * Prevent negative offsets in MySQL * @param int $offset * @return $this * @chainable */ public function offset($offset) { if ($offset < 0) { $offset = 0; } return parent::offset($offset); }