PHPackages                             xkojimedia/laravel-altair-graphql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xkojimedia/laravel-altair-graphql

ActiveLibrary[API Development](/categories/api)

xkojimedia/laravel-altair-graphql
=================================

Easily integrate Altair GraphQL Client into your Laravel project

v0.2.0(5y ago)76.7k↓33.3%3[3 issues](https://github.com/XKojiMedia/laravel-altair-graphql/issues)MITPHPPHP &gt;=7.1

Since Jan 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/XKojiMedia/laravel-altair-graphql)[ Packagist](https://packagist.org/packages/xkojimedia/laravel-altair-graphql)[ RSS](/packages/xkojimedia-laravel-altair-graphql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel Altair GraphQL
======================

[](#laravel-altair-graphql)

Easily integrate [Altair GraphQL Client](https://altair.sirmuel.design/) into your Laravel projects.

[![GitHub license](https://camo.githubusercontent.com/ba4114666da86a864702243c4ca654e5a13f04e1f7f4c60115a6fdfe38ba2e8e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f786b6f6a696d656469612f6c61726176656c2d616c746169722d6772617068716c2e737667)](https://github.com/xkojimedia/laravel-altair-graphql/blob/master/LICENSE)[![Packagist](https://camo.githubusercontent.com/31a5291c418d1c596732b9429e76395c0aa96d8f2d9d8ce684ccea52105696b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f786b6f6a696d656469612f6c61726176656c2d616c746169722d6772617068716c2e737667)](https://packagist.org/packages/xkojimedia/laravel-altair-graphql)[![Packagist](https://camo.githubusercontent.com/47016c61e244b3b35f3c2662175a481cd52f61bd5fcc253a268b9dd6fc89cfd1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f786b6f6a696d656469612f6c61726176656c2d616c746169722d6772617068716c2e737667)](https://packagist.org/packages/xkojimedia/laravel-altair-graphql)[![StyleCI](https://camo.githubusercontent.com/41bdeb1f94566024f9c7af9eb41afb94538301181d7349dbcd6d5f8f782fbd5b/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3233333330303735312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/233300751)

[![altair-graphql](https://camo.githubusercontent.com/fb1e3916ea0ce9c5c99746477cfb7f561813767617e6f772687d596aa8f7b8e7/68747470733a2f2f692e696d6775722e636f6d2f6836334f4250412e706e67)](https://camo.githubusercontent.com/fb1e3916ea0ce9c5c99746477cfb7f561813767617e6f772687d596aa8f7b8e7/68747470733a2f2f692e696d6775722e636f6d2f6836334f4250412e706e67)

> **Please note**: This is not a GraphQL Server implementation, only a UI for testing and exploring your schema. For the server component we recommend [nuwave/lighthouse](https://github.com/nuwave/lighthouse).

---

***DISCLAIMER: This is a port of [laravel-graphql-playground](https://github.com/mll-lab/laravel-graphql-playground) from [@spawnia](https://github.com/spawnia) of [mll-lab](https://github.com/mll-lab), but for [Altair GraphQL Client](https://altair.sirmuel.design/).***

Installation
------------

[](#installation)

```
composer require xkojimedia/laravel-altair-graphql

```

If you are using Laravel &lt; 5.4, add the service provider to your `config/app.php`

```
'providers' => [
    // Other providers...
    XKojiMedia\AltairGraphQL\AltairGraphQLServiceProvider::class,
]
```

If you are using Lumen, register the service provider in `bootstrap/app.php`

```
$app->register(XKojiMedia\AltairGraphQL\AltairGraphQLServiceProvider::class);
```

Configuration
-------------

[](#configuration)

By default, Altair is reachable at `/altair`and assumes a running GraphQL endpoint at `/graphql`.

To change the defaults, publish the configuration with the following command:

```
php artisan vendor:publish --provider="XKojiMedia\AltairGraphQL\AltairGraphQLServiceProvider" --tag=config

```

You will find the configuration file at `config/altair-graphql.php`.

If you are using Lumen, copy it into that location manually and load the configuration in your `boostrap/app.php`:

```
$app->configure('altair-graphql');
```

Customization
-------------

[](#customization)

To customize Altair even further, publish the view:

```
php artisan vendor:publish --provider="XKojiMedia\AltairGraphQL\AltairGraphQLServiceProvider" --tag=views

```

You can use that for all kinds of customization.

### Change settings of the Altair instance

[](#change-settings-of-the-altair-instance)

Check  for the allowed config options, for example:

```

  var altairOptions = {
    endpointURL: "{{url(config('altair-graphql.endpoint'))}}"
  };

  window.addEventListener("load", function() {
    AltairGraphQL.init(altairOptions);
  });

```

### Configure session authentication

[](#configure-session-authentication)

If you use GraphQL through sessions and CSRF, add the following to the body:

```
window.__CSRF_TOKEN__ = "{{ csrf_token() }}";
```

Modify the Altair config like so:

```
AltairGraphQL.init({
  endpointURL: "{{url(config('altair-graphql.endpoint'))}}",
+ initialPreRequestScript: "altair.helpers.setEnvironment('csrf_token', window.__CSRF_TOKEN__);",
+ initialHeaders: {
+   'X-CSRF-TOKEN': '{{ csrf_token }}'
+ }
})
```

Local assets
------------

[](#local-assets)

If you want to serve the assets from your own server, you can download them with the command

```
php artisan altair-graphql:download-assets

```

This puts the necessary CSS, JS and Favicon into your `public` directory. If you have the assets downloaded, they will be used instead of the online version from the CDN.

Security
--------

[](#security)

If you do not want to enable Altair GraphQL in production, you can disable it in the config file. The easiest way is to set the environment variable `ALTAIR_GRAPHQL_ENABLED=false`

If you want to add custom middleware to protect the route to Altair GraphQL, you can add it in the configuration file.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~382 days

Total

2

Last Release

1930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71fe9eb20625980548298b3a4500e7bb4958480466338e0bd88e76ab39f8a282?d=identicon)[imolorhe](/maintainers/imolorhe)

---

Top Contributors

[![imolorhe](https://avatars.githubusercontent.com/u/4608143?v=4)](https://github.com/imolorhe "imolorhe (7 commits)")

---

Tags

laravelgraphqlgraphiqlaltair-graphql

### Embed Badge

![Health badge](/badges/xkojimedia-laravel-altair-graphql/health.svg)

```
[![Health](https://phpackages.com/badges/xkojimedia-laravel-altair-graphql/health.svg)](https://phpackages.com/packages/xkojimedia-laravel-altair-graphql)
```

###  Alternatives

[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.7M93](/packages/nuwave-lighthouse)[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[neuron-core/neuron-laravel

Official Neuron AI Laravel SDK.

10710.0k](/packages/neuron-core-neuron-laravel)[thecodingmachine/graphqlite-laravel

A Laravel service provider package to help you get started with GraphQLite in Laravel.

1852.3k1](/packages/thecodingmachine-graphqlite-laravel)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
