← Back to Packages

Package

Laravel Linear

PHP Laravel

Stateless Linear GraphQL and OAuth 2 client for Laravel with rotating refresh tokens.

Overview

LinearOAuthClient implements a textbook OAuth 2 authorization-code flow: build the authorize URL, exchange the callback code for a token set, refresh, and revoke on disconnect. LinearClient talks GraphQL with the access token to list teams, create issues, and close them. Distinct exceptions (LinearInvalidGrant, LinearAuthFailed, LinearRequestFailed) tell you exactly why a call failed.

Installation

composer require labrodev/laravel-linear

Tips

  • Refresh tokens are single-use and rotate on every refresh; always store the full returned pair atomically.
  • On LinearInvalidGrant, clear the stored token set and send the user back through OAuth.
  • Access tokens expire after roughly 24 hours; refresh when expiresAt is near.
View on GitHub →