v2.0.0
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 nowcount(), which counts the number of models in the current collection. - The collection
getModelsCount()method is nowtotalCount(), 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 nowcreateComment()and requires aCreateCommentmodel as its parameter - see wiki for example. - Tickets API:
postTicket()is nowcreateTicket()and requires aCreateTicketmodel as its parameter - see wiki for example. - Tickets API:
downloadAttachment()now takes an ID as its parameter. - Users API:
postUser()is nowcreateUser()and requires aCreateUsermodel as its parameter - see wiki for example. - Users API:
updateUser()now requires a user ID for the first parameter and aUpdateUsermodel as its parameter - see wiki for example. - Users API:
getCustomFields()is nowgetUserCustomFields(). - Users API:
getCustomField()is nowgetUserCustomField(). - Users API:
getGroups()is nowgetUserGroups(). - Users API:
getGroup()is nowgetUserGroup().