Skip to content

Commit

Permalink
Finish the library and add webhook handler
Browse files Browse the repository at this point in the history
  • Loading branch information
c-delouvencourt committed Oct 16, 2024
1 parent 82ec81c commit d9e6d36
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cldt/laravel-aircall",
"version": "1.0.4",
"version": "1.0.5",
"description": "API Wrapper for the Aircall API",
"keywords": [
"cldt",
Expand Down
11 changes: 11 additions & 0 deletions src/Helpers/AircallApiPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,15 @@ public function getPreviousPageLink()
{
return $this->previousPageLink;
}

public function toArray(){
return [
'count' => $this->count,
'total' => $this->total,
'current_page' => $this->currentPage,
'per_page' => $this->perPage,
'next_page_link' => $this->nextPageLink,
'previous_page_link' => $this->previousPageLink,
];
}
}
16 changes: 16 additions & 0 deletions src/Helpers/AircallApiResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,20 @@ public function getPagination(): AircallApiPagination
return $this->meta;
}

public function toArray(): array
{
return [
'statusCode' => $this->statusCode,
'hasError' => $this->hasError,
'message' => $this->message,
'verbose' => $this->verbose,
'meta' => $this->meta->toArray(),
'data' => $this->data
];
}

public function toString(): string{
return json_encode($this->data);
}

}

0 comments on commit d9e6d36

Please sign in to comment.