Download the PHP package glhd/linearavel without Composer
On this page you can find all versions of the php package glhd/linearavel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package linearavel
Linearavel
Linearavel is a fully-featured Linear SDK for PHP and Laravel.
Every query, mutation, input and data object in this package is generated by walking Linear's GraphQL schema and building the matching PHP syntax tree, so the PHP API matches the GraphQL API one for one. A scheduled job rebuilds the package whenever Linear changes their schema.
Installation
Then add your API key to your .env file:
You can create a key under Settings → Security & access → Personal API keys in Linear. To publish the config file:
Usage
Linear uses GraphQL, which tends not to be particularly compatible with how PHP applications interact with APIs. This package bridges that gap—making API calls feel fluent while still exposing all the power of the Linear API.
Queries
A typical API call looks something like:
Calling get() gives you the query results directly:
Call get() with no arguments to fetch a sensible default set of fields, or pass '*'
alongside your own to get the defaults plus extras.
There is also a linear() helper, if you prefer it to the facade:
Filtering and ordering
Query arguments are typed, so your editor can tell you what each query accepts:
Arguments are sent as GraphQL variables rather than being written into the query string, so enums, dates, lists and nested input objects all serialize correctly.
Mutations
Mutations follow the same shape, with a Mutation suffix on the method name:
Responses
Instead of get(), call response() to get a LinearResponse—a custom
Saloon object that exposes things like status() and
headers(), and that you can resolve() into a fully-typed Linear data object.
Errors
Linear reports GraphQL errors with a 200 status code, so this package inspects the
response body as well as the status. Any request that comes back with errors throws a
LinearRequestException:
Union types
A handful of Linear queries return a union. Those resolve to whichever member type came back, and every member implements an interface named after the union:
Keeping up with Linear
The local.graphql file in this repository is Linear's schema, and everything under
src/Data, src/Requests and src/Responses is generated from it. A scheduled
workflow fetches the live schema every day and, when it changes, rebuilds the package
and tags a release. Removed or narrowed schema types move the minor version; additions
move the patch version.
Schema downloads do not require a Linear API key. To rebuild locally:
Contributing
Generated code should never be edited by hand—change the transformers under
src/Support/CodeGeneration and re-run composer generate-data instead. Run the test
suite with composer test and the style checks with composer check-style.
All versions of linearavel with dependencies
ext-json Version *
illuminate/support Version ^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.8|^8.0
nikic/php-parser Version ^5.0
saloonphp/saloon Version ^4.0
spatie/laravel-data Version ^4.11
webonyx/graphql-php Version ^15.34.1