Download the PHP package yakovenko/laravel-lighthouse-graphql-multi-schema without Composer

On this page you can find all versions of the php package yakovenko/laravel-lighthouse-graphql-multi-schema. 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 laravel-lighthouse-graphql-multi-schema

Lighthouse GraphQL Multi-Schema

Latest Version on Packagist Total Downloads PHP Version License

Run multiple independent GraphQL schemas in a single Laravel application. Each schema gets its own route, middleware, cache, and developer tooling - with full support for Laravel Octane.

Typical use cases: admin vs public API, API versioning (v1/v2/v3), domain-driven or modular architectures.


🚀 Key Features


📦 Requirements

Dependency Version
PHP ^8
Laravel ^9.0 | ^10.0 | ^11.0 | ^12.0 | ^13.0
Nuwave Lighthouse ^6.0

⚙️ Installation

1. Install via Composer

2. Publish the configuration

This creates config/lighthouse-multi-schema.php where you define your schemas.


🔧 Configuration

Each schema entry requires a route URI, a schema file path, and optionally cache settings and middleware.

The default Lighthouse schema (configured via lighthouse.schema_path) continues to work as before - this package only extends it.


🛡️ CSRF Protection

GraphQL routes use POST and should be excluded from CSRF verification.

Laravel 11+ - bootstrap/app.php

Laravel 9 / 10 - app/Http/Middleware/VerifyCsrfToken.php


💻 Artisan Commands

Quick Reference

Command Description
lighthouse:multi-cache [schema] Compile and cache schemas
lighthouse:multi-clear [schema] Clear cached schemas
lighthouse:multi-validate [schema] Validate schemas
lighthouse:multi-ide-helper [schema] Generate IDE helper files

All commands operate on all schemas when called without an argument, or on a specific schema when a name is provided.


Cache Management

Warm the schema cache before deployment to avoid cold-start latency in production.

Schema Validation

Catch syntax, type, and directive errors before they reach production.

IDE Helper Generation

Generate per-schema autocompletion files for your IDE.

Generated files per schema:

Add these to .gitignore:

CI/CD Integration


⚡ Octane / Long-lived Workers

The package is designed for use with Laravel Octane (Swoole, RoadRunner, FrankenPHP). Schema services are cached per-schema per-worker using SchemaKeyedContainer, so each schema is built exactly once per worker lifetime - eliminating redundant AST parsing on every request without state pollution between schemas.


🔄 Upgrading from v2.2

Deprecated flag syntax — the --schema= flag is replaced by a positional argument. It remains supported with a deprecation warning.

Old syntax (still works) New syntax
lighthouse:multi-validate-schema --schema=admin lighthouse:multi-validate admin
lighthouse:multi-ide-helper --schema=admin lighthouse:multi-ide-helper admin
lighthouse:clear-cache all lighthouse:multi-clear

New commands in v2.3

Command Notes
lighthouse:multi-cache No equivalent in previous versions
lighthouse:multi-clear Standalone command. No argument = clears all schemas

lighthouse:clear-cache is unchanged — without an argument it still clears only the default schema. Use lighthouse:multi-clear to clear all schemas at once.


📂 Directory Structure

There is no required structure - organize schema files however fits your project.

Simple (small projects or API versioning)

By API surface (recommended - admin, app, public, etc.)

Each schema folder has a single entry point file that stitches together shared models and its own requests via #import. This keeps schemas fully isolated while sharing common type definitions.


📄 Changelog

See Releases for the full release history.


🤝 Contributing

Bug reports and pull requests are welcome on GitHub. Please open an issue before submitting large changes.


License

MIT. See LICENSE for details.


Author: Alexander Yakovenko - Senior Software Engineer specializing in Laravel, GraphQL, and high-load systems.


All versions of laravel-lighthouse-graphql-multi-schema with dependencies

PHP Build Version
Package Version
Requires php Version ^8
nuwave/lighthouse Version ^6.0
laravel/framework Version ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
haydenpierce/class-finder Version ^0.4 || ^0.5
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 yakovenko/laravel-lighthouse-graphql-multi-schema contains the following files

Loading the files please wait ...