Download the PHP package michaelcooke/orthrus without Composer
On this page you can find all versions of the php package michaelcooke/orthrus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michaelcooke/orthrus
More information about michaelcooke/orthrus
Files in michaelcooke/orthrus
Package orthrus
Short Description A simple opinionated implementation of ESI for Laravel
License MIT
Informations about the package orthrus
Orthrus
Orthrus is a simple opinionated implementation of ESI for Laravel that provides an easy to use interface for all ESI endpoints, delivering original JSON responses in easily accessible Eloquent collections.
Installing Orthrus
Require Orthrus via Composer
Simply require Orthrus through Composer to pull the package into your project.
Configure Eseye
Orthrus depends on Eseye to take care of caching, logging, and making ESI requests that Orthrus builds up. Configuring Eseye may be done through your .env
configuration file, making switching between ESI application details as well as caching and logging mechanisms between production and development environments easy.
Include the following in your .env
configuration file and add your ESI application client id and key. In addition, you may specify a refresh token to use for all Orthrus ESI calls by default.
ESEYE_DATASOURCE
may be tranquility
or singularity
.
ESEYE_CACHE
may be file
, redis
or memcached
, and will attempt to use default configuration options where applicable.
Using Orthrus
Accessing ESI endpoints through Orthrus is easily done with a natural syntax while adhering closely to the verbage of the ESI spec. An easy-to-use ESI
facade is also provided, making ESI calls dead-simple.
Making ESI Calls
Orthrus's syntax is straight-forward and adheres closely to the verbage and conventions of the ESI spec.
In some cases, aliases are provided to reflect more common verbage that may differ from the ESI spec.
Accessing the Response
Every ESI call made through Orthrus will return an object decoded from the original JSON response.
Helper Methods
Set ESI Route Version
By default, Orthrus will use the /latest/
version route for all ESI calls. You may override this for an ESI call.
Set/Override Default Refresh Token
You may set or override the default refresh token for all ESI calls made through Orthrus for a request lifecycle.
Reset Default Refresh Token
If you wish to set the default refresh token for all ESI calls made through Orthrus after changing it with setRefreshToken()
, you may reset it to the default defined in your .env
configuration file.
Using Alternative Refresh Token For One ESI Call
You may use an alternative refresh token for a single ESI call through Orthrus.
This is particularly useful for endpoints which require the call to be made from a refresh token belonging to a character with a particular role or level of access in a corporation, and you don't want to set and reset the refresh token used by Orthrus manually.
Accessing Ancillary Response Information
It can be useful in some situations to be able to evaluate the response code, expiration, and potential error message from a response. To do so, you may use the following methods below.