PHPackages                             mll-lab/laravel-graphiql - 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. mll-lab/laravel-graphiql

ActiveLibrary[API Development](/categories/api)

mll-lab/laravel-graphiql
========================

Easily integrate GraphiQL into your Laravel project

v4.1.0(3mo ago)633.8M↓24.6%199MITPHPPHP ^8CI passing

Since Aug 26Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/mll-lab/laravel-graphiql)[ Packagist](https://packagist.org/packages/mll-lab/laravel-graphiql)[ RSS](/packages/mll-lab-laravel-graphiql/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (24)Versions (27)Used By (9)

Laravel GraphiQL
================

[](#laravel-graphiql)

A thin wrapper for serving [the GraphiQL UI](https://github.com/graphql/graphiql/tree/main/packages/graphiql) from Laravel

[![GitHub license](https://camo.githubusercontent.com/36d16e6d88684d510158f73bd7ae099872fd3347bfc4a10b0a27bc89e089bee8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6c6c2d6c61622f6c61726176656c2d677261706869716c2e737667)](https://github.com/mll-lab/laravel-graphqil/blob/master/LICENSE)[![Packagist](https://camo.githubusercontent.com/ca506c685ba2810059a7667e82bcb2dddd1fd3f793cf167be703cc77ef9465d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c6c2d6c61622f6c61726176656c2d677261706869716c2e737667)](https://packagist.org/packages/mll-lab/laravel-graphqil)[![Packagist](https://camo.githubusercontent.com/e11c9344ba961ec594cc113494be6d820416409abe340f3b41249baeec14e431/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6c6c2d6c61622f6c61726176656c2d677261706869716c2e737667)](https://packagist.org/packages/mll-lab/laravel-graphqil)

[![Screenshot of GraphiQL with Doc Explorer Open](https://raw.githubusercontent.com/graphql/graphiql/main/packages/graphiql/resources/graphiql.png)](https://raw.githubusercontent.com/graphql/graphiql/main/packages/graphiql/resources/graphiql.png)

> **Please note**: This is a UI for testing and exploring your schema and does not include a GraphQL server implementation. To serve a GraphQL API from Laravel, we recommend [nuwave/lighthouse](https://github.com/nuwave/lighthouse).

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

[](#installation)

Install the package via [composer](https://getcomposer.org):

```
composer require mll-lab/laravel-graphiql
```

Due to [Laravel package discovery](https://laravel.com/docs/packages#package-discovery), this package will automatically register and is then ready to use without configuration.

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

```
$app->register(MLL\GraphiQL\GraphiQLServiceProvider::class);
```

Upgrade Guide
-------------

[](#upgrade-guide)

When upgrading between major versions, consider [`UPGRADE.md`](UPGRADE.md).

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

[](#configuration)

By default, the GraphiQL UI is reachable at `/graphiql` and assumes a running GraphQL endpoint at `/graphql`. To change those defaults, publish the configuration with the following command:

```
php artisan vendor:publish --tag=graphiql-config
```

You will find the configuration file at `config/graphiql.php`.

### Lumen

[](#lumen)

If you are using Lumen, copy [src/graphiql.php](src/graphiql.php) to `config/graphiql.php` manually. Then load the configuration in your `boostrap/app.php`:

```
$app->configure('graphiql');
```

### HTTPS behind proxy

[](#https-behind-proxy)

If your application sits behind a proxy which resolves https, the generated URL for the endpoint might not use `https://`. This may cause the GraphiQL UI to not work by default. To solve this, configure your `TrustProxies` middleware to contain `\Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR` in `$headers`.

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

[](#customization)

To customize the GraphiQL UI even further, publish the view:

```
php artisan vendor:publish --tag=graphiql-view
```

You can use that for all kinds of customization.

### Change settings of the GraphiQL UI instance

[](#change-settings-of-the-graphiql-ui-instance)

Add extra props in the call to `React.createElement(GraphiQL, ...)` in the published view.

```
React.createElement(GraphiQL, {
  ...,
  // See https://github.com/graphql/graphiql/tree/main/packages/graphiql#props for available settings
});
```

### Configure session authentication

[](#configure-session-authentication)

Session-based authentication can be used with [Laravel Sanctum](https://laravel.com/docs/sanctum). If you use GraphQL through sessions and CSRF, add the following to the `` in the published view:

```
+
```

Modify the GraphiQL props as follows:

```
const fetcher = GraphiQL.createFetcher({
    url: '{{ $url }}',
    subscriptionUrl: '{{ $subscriptionUrl }}',
+   headers: {
+       'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
+   },
});
```

Make sure your route includes the `web` middleware group in `config/graphiql.php`:

```
    'routes' => [
        '/graphiql' => [
            'name' => 'graphiql',
+           'middleware' => ['web']
        ],
    ],
```

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

[](#local-assets)

To serve the assets from your own server, download them with:

```
php artisan graphiql: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 the GraphiQL UI in production, you can disable it in the config file. The easiest way is to set the environment variable `GRAPHIQL_ENABLED=false`.

If you want to protect the route to the GraphiQL UI, you can add custom middleware in the config file.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.1% 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 ~52 days

Recently: every ~79 days

Total

26

Last Release

109d ago

Major Versions

v1.2.2 → v2.0.02023-04-13

v2.0.3 → v3.0.02023-05-17

v3.3.3 → v4.0.02025-05-07

v3.3.4 → v4.1.02026-03-18

PHP version history (2 changes)v1.0.0PHP ^7.1 || ^8

v3.0.0PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ff5d1af2c0f601f7ed7e75e15be0aa4c062149b57fd5aace4e44cc37b8b7a40?d=identicon)[spawnia](/maintainers/spawnia)

---

Top Contributors

[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (54 commits)")[![hschaefler](https://avatars.githubusercontent.com/u/91871854?v=4)](https://github.com/hschaefler "hschaefler (1 commits)")[![Kyrch](https://avatars.githubusercontent.com/u/66730850?v=4)](https://github.com/Kyrch "Kyrch (1 commits)")[![mfn](https://avatars.githubusercontent.com/u/87493?v=4)](https://github.com/mfn "mfn (1 commits)")[![mostafa-rz](https://avatars.githubusercontent.com/u/71334549?v=4)](https://github.com/mostafa-rz "mostafa-rz (1 commits)")[![muba00](https://avatars.githubusercontent.com/u/11701997?v=4)](https://github.com/muba00 "muba00 (1 commits)")[![TheMhv](https://avatars.githubusercontent.com/u/25031483?v=4)](https://github.com/TheMhv "TheMhv (1 commits)")[![GeoSot](https://avatars.githubusercontent.com/u/22406063?v=4)](https://github.com/GeoSot "GeoSot (1 commits)")[![Yannick-Bruening](https://avatars.githubusercontent.com/u/69695342?v=4)](https://github.com/Yannick-Bruening "Yannick-Bruening (1 commits)")

---

Tags

graphiqlgraphqllaravellaravelgraphqlgraphiql

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mll-lab-laravel-graphiql/health.svg)

```
[![Health](https://phpackages.com/badges/mll-lab-laravel-graphiql/health.svg)](https://phpackages.com/packages/mll-lab-laravel-graphiql)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725173.2k14](/packages/tallstackui-tallstackui)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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