Download the PHP package dniccum/linear-sdk without Composer

On this page you can find all versions of the php package dniccum/linear-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package linear-sdk

Linear SDK for Laravel

[!NOTE] This is an unofficial, community-built package. It is not affiliated with, endorsed by, or sponsored by Linear. "Linear" and the Linear logo are trademarks of Linear. This package simply talks to Linear's public API.

Latest Version on Packagist Tests Code Style Total Downloads

Create Linear issues from your Eloquent models, the way Laravel Spark handles billing: add a trait to a model, let your users connect their Linear workspace on a ready-made configuration page, and issues are created for you from the model's lifecycle events.

Requirements

Installation

Publish and run the migrations, then (optionally) the config file and the page's compiled assets:

Tag Publishes
linear-config config/linear.php
linear-migrations the four tables (set table_prefix / key_type in the config before migrating)
linear-views the Blade views, so you can restyle the page
linear-assets the compiled JS/CSS to public/vendor/linear

Keep the front-end assets up to date

The configuration page's JavaScript and CSS are published into your public directory, so a copy from an older release stays there until you publish again. The page reads its asset manifest from the installed package but serves the files from public/vendor/linear, so after an upgrade with stale published files the page would link to bundles that no longer exist and fail to load. Re-publish them every time Composer updates the package by adding the command to the post-update-cmd scripts in your application's composer.json:

(laravel-assets is already there in a default Laravel application; add the linear-assets line beneath it.) The --force flag overwrites the previously published files, and the compiled files use hashed names, so browsers pick up the new version straight away. If you deploy with composer install, run the same command as a deploy step, or add it to post-install-cmd too.

If you do not use the built-in page (the ui route group is off, or you build your own UI), you can skip this.

Make sure a queue worker is running; issues and comments are sent from queued jobs.

Configuration

For OAuth, create an application at Linear → Settings → API → OAuth applications and register https://your-app.test/linear/callback as its callback URL. The requested scopes are read, issues:create and comments:create; the grant is refused if Linear returns fewer.

In api_key mode each owner pastes a personal API key (Linear → Settings → API). It is validated against Linear when saved, stored encrypted, and never expires.

Every option is documented in config/linear.php.

Quick start

1. Mark the owner

The owner is whoever connects a Linear workspace: usually a User or a Team.

2. Mark the models that become issues

That's it. When a SupportRequest is created and its owner has an active connection with a destination in automatic mode, an issue is filed in Linear. The model gains:

3. Send manually, retry, comment

4. Open the page

Visit /linear while signed in. Done.

Tying issues to model lifecycle events

Override linearEvents() to choose which events act on Linear (default: ['created']):

Event Not yet linked Already linked
created / updated files the issue (when the owner is in automatic mode) updated: posts a comment listing changes if on_update is comment; otherwise nothing
deleted nothing posts "was deleted" if on_delete is comment; otherwise nothing

Set on_update / on_delete in config/linear.php.

Customising the issue

Override any hook on your model (or implement Dniccum\Linear\Contracts\ComposesLinearIssue to take full control):

Events

Listen for what happened:

The configuration page

GET /linear renders a standalone, branded page: connection card, destination form (team, project, status, labels, priority, assignee, automatic / manual), and a list of recent failures with a retry button.

Branding

Run php artisan vendor:publish --tag=linear-views to change the markup.

Authorization and the owner

By default the signed-in user ($request->user()) is the owner and the routes use the web and auth middleware. Customise from a service provider:

Change the URL or middleware with path and middleware in the config.

Back link

A "Back" link at the top of the page lets users leave the configuration interface. The text and the destination are both configurable, and the destination defaults to /dashboard:

When the destination depends on who is looking (a team, a tenant), choose it at runtime from a service provider's boot() method. The callback receives the owner and returns a route name, a path or a URL, or null to hide the link; it takes precedence over back.url:

The link is part of the settings payload (back) and of Linear::settingsFor($owner)->back, so custom UIs can render it too. If you embed <x-linear::settings /> inside your own layout, set back.enabled to false.

Signed-out users

If a user's session expires while they are using the page (or they open it signed out), they are sent to your login page instead of seeing a raw error. The page's requests that come back 401 or 419 redirect the browser, and package routes reached without a signed-in user redirect there too. The destination defaults to your login route and is configurable:

Embedding or disabling it

Embed the page inside your own layout, with the route group turned off:

The three route groups (ui, oauth, api) are independent. To register no routes at all, call Linear::ignoreRoutes() from a service provider's register() method.

Building your own UI

Everything the page does is available as headless, typed Actions, and as a documented HTTP contract (docs/custom-ui.md.

Disable the package routes (routes.* => false or Linear::ignoreRoutes()) and wire the Actions into your own controllers, Inertia pages or Livewire components.

Team, project, status and member visuals

The data the Actions return (and $owner->linearClient() / Linear::client($owner)) carries what Linear itself shows next to each choice, so a custom UI can look like Linear. All of it is optional (null when Linear sends nothing):

DTO Visual properties
Team color (hex), icon (an emoji or a Linear icon name, never a URL), iconIsEmoji()
Project color, icon, iconIsEmoji()
WorkflowState color, type (triage, backlog, unstarted, started, completed, canceled, duplicate), kind() returning a LinearStateType
Member avatarUrl, initials, avatarBackgroundColor, displayInitials()

Priorities have no API data, so Dniccum\Linear\Enums\LinearPriority lists them (NoPriority=0, Urgent=1, High=2, Medium=3, Low=4) with label() and options(). toArray() on each DTO matches the HTTP contract exactly.

docs/custom-ui.md documents every field (type, nullability, meaning), how icons, colours and avatars should be rendered, what each status type means, and includes a complete custom controller and Blade view that works without the bundled UI.

[!IMPORTANT] Avatars are loaded by the browser directly from the avatarUrl Linear returns (the package never proxies them). If your app sends a strict Content-Security-Policy, its img-src directive must allow the image hosts of your members' avatars, in the bundled page as well as in your own UI. When an image is blocked or fails to load, the bundled page falls back to the member's initials on their avatar colour, so nothing breaks; it simply looks plainer.

Testing your application

Linear::fake() swaps Linear for an in-memory double, so no HTTP request is made:

Available helpers: withTeams(), withTeamOptions(), withViewer(), withTokens(), failWith(), assertIssueCreated(), assertIssueCreatedCount(), assertNoIssueCreated(), assertCommentPosted(), assertNoCommentPosted(), assertNothingSent().

How it behaves

Frontend development

The page is TypeScript + Alpine compiled with Vite. The compiled assets are committed, so using the package never requires Node. To work on the page itself, see docs/frontend.md:

Testing the package

CI runs the PHP suite on PHP 8.3/8.4 × Laravel 12/13 × lowest/stable on Linux and Windows, plus PHPStan, Pint and the frontend checks.

Changelog

See CHANGELOG.

Contributing

See CONTRIBUTING.

Credits

License

The MIT License (MIT). See LICENSE.


All versions of linear-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/bus Version ^12.0||^13.0
illuminate/cache Version ^12.0||^13.0
illuminate/contracts Version ^12.0||^13.0
illuminate/database Version ^12.0||^13.0
illuminate/http Version ^12.0||^13.0
illuminate/queue Version ^12.0||^13.0
illuminate/routing Version ^12.0||^13.0
illuminate/support Version ^12.0||^13.0
illuminate/validation Version ^12.0||^13.0
illuminate/view Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dniccum/linear-sdk contains the following files

Loading the files please wait ...