Skip to content

v2.0.0

Choose a tag to compare

@jshah4517 jshah4517 released this 11 Jun 09:44
· 28 commits to master since this release
20b87ae

What's Changed

  • There have been large updates to the library to improve the flexibility of using the client with different SupportPal versions and also allow changes to the API on the SupportPal software side in the future without needing to update the client as regularly.
  • The library now adopts a Laravel Eloquent model approach for the data returned.
  • For responses with more than one model, a collection is returned and this can now utilise the Laravel Collection available methods.
  • The dependencies have been bumped so it can be used with Symfony 7.x.
  • There are a large number of breaking changes which have been documented below.
  • A number of new API endpoints are now supported, the wiki contains the full list of endpoints supported.

Full Changelog: v1.7.1...v2.0.0

Breaking Changes

  • Minimum PHP version has been bumped to 8.1.
  • Minimum SupportPal version has been bumped to 5.0.0.
  • Previously the object returned would have its data accessed with 'getters' such as $ticket->getId(), this is now $ticket->id. This applies to all models returned by the client.
  • The collection getCount() method is now count(), which counts the number of models in the current collection.
  • The collection getModelsCount() method is now totalCount(), which counts the total number of records that were found for this endpoint but not the (limited) data that was returned.
  • For unsupported endpoints, $api->getRequestFactory() has become $api->getRequest().
  • For all settings endpoints, the getSetting() method has been removed and the data can be accessed directly from the model by the setting name key. For example, $api->getCoreApi()->getSettings()->admin_folder.
  • Self-Service API: postComment() is now createComment() and requires a CreateComment model as its parameter - see wiki for example.
  • Tickets API: postTicket() is now createTicket() and requires a CreateTicket model as its parameter - see wiki for example.
  • Tickets API: downloadAttachment() now takes an ID as its parameter.
  • Users API: postUser() is now createUser() and requires a CreateUser model as its parameter - see wiki for example.
  • Users API: updateUser() now requires a user ID for the first parameter and a UpdateUser model as its parameter - see wiki for example.
  • Users API: getCustomFields() is now getUserCustomFields().
  • Users API: getCustomField() is now getUserCustomField().
  • Users API: getGroups() is now getUserGroups().
  • Users API: getGroup() is now getUserGroup().