PHPackages                             aarab/laravel-graphql-playground - 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. aarab/laravel-graphql-playground

ActiveLibrary[API Development](/categories/api)

aarab/laravel-graphql-playground
================================

Easily integrate GraphQL Playground into your Laravel project

v1.0.0(2y ago)011MITPHPPHP ^7.1 || ^8

Since Mar 24Pushed 2y agoCompare

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

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

Laravel GraphQL Playground
==========================

[](#laravel-graphql-playground)

Deprecated
----------

[](#deprecated)

This project is deprecated in favor of .

Easily integrate [GraphQL Playground](https://github.com/prismagraphql/graphql-playground) into your Laravel projects.

[![GitHub license](https://camo.githubusercontent.com/c9c6a3910fe66cbcf75f00c2f7ff51a83f59bd86d473cfb1f166ddf17b2832e2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6c6c2d6c61622f6c61726176656c2d6772617068716c2d706c617967726f756e642e737667)](https://github.com/mll-lab/laravel-graphql-playground/blob/master/LICENSE)[![Packagist](https://camo.githubusercontent.com/db329afc038409755e46adca295434e75c3d4e215902339c65cc3639c7227c10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c6c2d6c61622f6c61726176656c2d6772617068716c2d706c617967726f756e642e737667)](https://packagist.org/packages/mll-lab/laravel-graphql-playground)[![Packagist](https://camo.githubusercontent.com/dc79fd27c586d428f079b394c9a62a469d583237bd4ccf5a9f79fce877732a5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6c6c2d6c61622f6c61726176656c2d6772617068716c2d706c617967726f756e642e737667)](https://packagist.org/packages/mll-lab/laravel-graphql-playground)

[![](https://camo.githubusercontent.com/f92fdc753c82e513ff917df3d9957375a3b2ff884a7eb2fb45d2caeb0976f6ff/68747470733a2f2f692e696d6775722e636f6d2f41453557364f572e706e67)](https://www.graphqlbin.com/RVIn)

> **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).

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

[](#installation)

```
composer require aarab/laravel-graphql-playground

```

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

```
$app->register(MLL\GraphQLPlayground\GraphQLPlaygroundServiceProvider::class);
```

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

[](#configuration)

By default, the playground is reachable at `/graphql-playground`and assumes a running GraphQL endpoint at `/graphql`.

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

```
php artisan vendor:publish --tag=graphql-playground-config

```

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

### Lumen

[](#lumen)

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

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

### 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://`, thus causing the Playground to not work by default. In order to solve this, configure your `TrustProxies` middleware to contain `\Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR`in `$headers`.

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

[](#customization)

To customize the Playground even further, publish the view:

```
php artisan vendor:publish --tag=graphql-playground-view

```

You can use that for all kinds of customization.

### Change settings of the playground instance

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

Add extra settings in the call to `GraphQLPlayground.init` in the published view:

```
GraphQLPlayground.init(document.getElementById('root'), {
  endpoint: "{{ url(config('graphql-playground.endpoint')) }}",
  subscriptionEndpoint: "{{ config('graphql-playground.subscriptionEndpoint') }}",
  // See https://github.com/graphql/graphql-playground#properties 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 Playground config:

```
GraphQLPlayground.init(document.getElementById('root'), {
  endpoint: "{{ url(config('graphql-playground.endpoint')) }}",
  subscriptionEndpoint: "{{ config('graphql-playground.subscriptionEndpoint') }}",
+ settings: {
+   'request.credentials': 'same-origin',
+   'request.globalHeaders': {
+     'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content
+   }
+ }
})
```

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

```
    'route' => [
        'uri' => '/graphql-playground',
        'name' => 'graphql-playground',
+       'middleware' => ['web']
    ]
```

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

[](#local-assets)

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

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

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 74% 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

Unknown

Total

1

Last Release

778d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86bfa05ed54d72458417cf0d3ec031611b206024e35a43f9729e6a8d56782e7e?d=identicon)[aaarab](/maintainers/aaarab)

---

Top Contributors

[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (71 commits)")[![ddedic](https://avatars.githubusercontent.com/u/49714?v=4)](https://github.com/ddedic "ddedic (9 commits)")[![mfn](https://avatars.githubusercontent.com/u/87493?v=4)](https://github.com/mfn "mfn (2 commits)")[![jeremytubbs](https://avatars.githubusercontent.com/u/548888?v=4)](https://github.com/jeremytubbs "jeremytubbs (2 commits)")[![jdeeburke](https://avatars.githubusercontent.com/u/270829?v=4)](https://github.com/jdeeburke "jdeeburke (1 commits)")[![jthomaschewski](https://avatars.githubusercontent.com/u/682607?v=4)](https://github.com/jthomaschewski "jthomaschewski (1 commits)")[![kevinpijning](https://avatars.githubusercontent.com/u/2886081?v=4)](https://github.com/kevinpijning "kevinpijning (1 commits)")[![marvinrabe](https://avatars.githubusercontent.com/u/515860?v=4)](https://github.com/marvinrabe "marvinrabe (1 commits)")[![pyrou](https://avatars.githubusercontent.com/u/235005?v=4)](https://github.com/pyrou "pyrou (1 commits)")[![rayronvictor](https://avatars.githubusercontent.com/u/1683922?v=4)](https://github.com/rayronvictor "rayronvictor (1 commits)")[![ssi-anik](https://avatars.githubusercontent.com/u/2676602?v=4)](https://github.com/ssi-anik "ssi-anik (1 commits)")[![aaarab](https://avatars.githubusercontent.com/u/80489522?v=4)](https://github.com/aaarab "aaarab (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")[![Davidnadejdin](https://avatars.githubusercontent.com/u/40993387?v=4)](https://github.com/Davidnadejdin "Davidnadejdin (1 commits)")[![hailwood](https://avatars.githubusercontent.com/u/709773?v=4)](https://github.com/hailwood "hailwood (1 commits)")[![half2me](https://avatars.githubusercontent.com/u/6759894?v=4)](https://github.com/half2me "half2me (1 commits)")

---

Tags

laravelgraphqlgraphql-playground

### Embed Badge

![Health badge](/badges/aarab-laravel-graphql-playground/health.svg)

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

###  Alternatives

[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.7M93](/packages/nuwave-lighthouse)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[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)
