Lighthouse
lighthouse-php.com
What it is
Lighthouse is a framework for serving GraphQL from an existing Laravel application. It uses GraphQL Schema Definition Language and server-side directives to describe data and add behavior, while reusing Laravel concepts and Eloquent models. Built-in directives can create records, resolve relationships, apply query constraints, paginate results, and validate fields and arguments. Developers can add custom directives for reusable behavior, while the @can directive family can use Laravel Policies to restrict field operations. The default endpoint is `/graphql`, and any GraphQL client can use it. Lighthouse also supports standard Laravel authentication mechanisms, including Sanctum, and GraphQL subscriptions for event updates. Parsed queries can be cached with Laravel cache stores or local PHP files using OPcache; Automatic Persisted Queries are supported with Apollo compatibility. Installation uses Composer in a Laravel or Lumen project. The package is free and self-hosted. GraphQL tooling such as GraphiQL is not included, and federation support is experimental and cannot serve as a federation gateway.
Spec sheet
- Purpose
- Lighthouse is a framework for serving GraphQL from Laravel.Read 8 Oct 2026 · lighthouse-php.com
- Authentication
- It supports standard Laravel authentication mechanisms and can use Laravel Sanctum for API authentication.Read 8 Oct 2026 · lighthouse-php.com
- Authorization
- The `@can` directive lets Lighthouse use Laravel Policies to restrict field operations.Read 8 Oct 2026 · lighthouse-php.com
- Caching
- Parsed GraphQL queries can be cached using Laravel cache stores or local PHP files with OPcache.Read 7 Oct 2026 · lighthouse-php.com
- CRUD and relationships
- Built-in directives support operations such as creating records and resolving Eloquent relationships.Read 7 Oct 2026 · lighthouse-php.com
- CSRF mitigation
- The optional `EnsureXHR` middleware blocks GET requests and POST requests that can be created using HTML forms to mitigate CSRF attacks.Read 8 Oct 2026 · lighthouse-php.com
- Custom directives
- Developers can implement custom directives to add reusable behavior to schema definitions.Read 7 Oct 2026 · lighthouse-php.com
- Data access features
- Built-in directives support Eloquent relationships, pagination, and query constraints.Read 8 Oct 2026 · lighthouse-php.com
- Developer tooling
- The installation documentation says Lighthouse does not include GraphQL tooling such as GraphiQL and shows GraphQL Playground as a separate package.Read 7 Oct 2026 · lighthouse-php.com
- Eloquent
- It works with existing Eloquent models and creates optimized database queries out of the box.Read 7 Oct 2026 · lighthouse-php.com
- Federation limitation
- Federation support is marked experimental, is not enabled by default, and cannot serve as a federation gateway.Read 8 Oct 2026 · lighthouse-php.com
- GraphQL endpoint
- The default GraphQL endpoint is `/graphql`, and the docs say any GraphQL client can use it.Read 8 Oct 2026 · lighthouse-php.com
- Install
- The docs install Lighthouse in a project with Composer using `composer require nuwave/lighthouse`.Read 8 Oct 2026 · lighthouse-php.com
- Installation
- The tutorial installs Lighthouse in a Laravel project with Composer using `composer require nuwave/lighthouse`.Read 7 Oct 2026 · lighthouse-php.com
- Laravel and Eloquent
- It works on an existing Laravel application and uses Eloquent models to create optimized database queries.Read 8 Oct 2026 · lighthouse-php.com
- Laravel integration
- It builds a GraphQL server on top of an existing Laravel application and is designed to reuse Laravel concepts and code.Read 7 Oct 2026 · lighthouse-php.com
- Lumen support
- The docs explain how to configure Lighthouse for Lumen and note that its service providers must be registered individually because Lumen does not support auto-discovery.Read 8 Oct 2026 · lighthouse-php.com
- Pagination and validation
- Schema directives include pagination and Laravel validation for GraphQL fields and arguments.Read 7 Oct 2026 · lighthouse-php.com
- Persisted queries
- Automatic Persisted Queries are supported with Apollo compatibility and are enabled by default when query caching is enabled.Read 7 Oct 2026 · lighthouse-php.com
- Plugins and tooling
- The resources page lists plugins including Lighthouse Sanctum and a Redis broadcaster, and recommends GraphiQL and GraphQL Voyager packages.Read 8 Oct 2026 · lighthouse-php.com
- Schema approach
- It uses GraphQL Schema Definition Language to describe data and server-side directives to add functionality.Read 7 Oct 2026 · lighthouse-php.com
- Schema definition
- It uses GraphQL Schema Definition Language (SDL) and server-side directives to describe data and add functionality.Read 8 Oct 2026 · lighthouse-php.com
- Subscription limit
- Subscriptions do not expire automatically; the docs recommend configuring a storage TTL or using a Pusher channel existence webhook.Read 8 Oct 2026 · lighthouse-php.com
- Subscriptions
- GraphQL subscriptions can use the Pusher driver or Laravel Echo driver.Read 8 Oct 2026 · lighthouse-php.com
- Validation
- Lighthouse supports Laravel validation rules for GraphQL queries and mutations through schema directives.Read 8 Oct 2026 · lighthouse-php.com
Plans and prices
Strong points and limits
Strong points
- Free package for Laravel or Lumen projects
- Built-in directives support relationships and pagination
- Supports Laravel validation and authentication
- Queries can use Laravel cache stores
- Supports subscriptions and persisted queries
Limits
- GraphQL tooling such as GraphiQL is not included
- Federation support is experimental
- Cannot serve as a federation gateway
Who it suits
Lighthouse suits developers building GraphQL services on Laravel or Lumen who want to work with existing Eloquent models and Laravel conventions. It is for self-hosted PHP applications rather than a hosted GraphQL service.
Verdict
Lighthouse offers GraphQL capabilities through Laravel’s existing application and data-model patterns. Its self-hosted approach and experimental federation support are important constraints to consider.
Where Specifiction places it
- GraphQL Tools#7 of 328.1