public function toJson($options = 0) { return json_encode(array('total' => $this->total, 'page' => $this->page, 'per_page' => $this->perPage, 'data' => json_decode($this->items->toJSON()))); }