Download the PHP package suitcasephp/builder without Composer
On this page you can find all versions of the php package suitcasephp/builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download suitcasephp/builder
More information about suitcasephp/builder
Files in suitcasephp/builder
Package builder
Short Description A simple to use SDK builder for PHP.
License MIT
Homepage https://github.com/SuitcasePHP/builder
Informations about the package builder

Suitcase Builder SDK
A simple to use SDK builder for PHP.
Install
Via Composer
How to use
Building the SDK
Adding Resources to the SDK:
If you want to pass in a resource that follows the defaults:
What this will do is use the string passed in as a name and an endpoint, and pass through the default allows options - basically allowing all operations.
Selecting a resource is pretty simple:
What this will do is set the active resource on the SDK allowing you to use the allowed actions. A MethodNotAllowed
is throw if the action is not registered in the allows
array on the resource.
Performing actions on a resource:
You also have the ability to append sub-resources onto the query using the new append
method:
This will return a streamed response from the server from the URL: /posts/1/comments
Need to handle authenticated endpoints?
There is a relatively simple approach to this using this package, first you must have an API token or be using basic auth:
What happens here is the auth header will be set to: Authorization: Bearer your-api-token
and added as a header in Guzzle.
By default the type is not needed as it defaults to Bearer
so omit this if you are using a bearer token.
Please note that API authentication is not the main aim of this package, it is just a welcomed addition for some scenarios.