Laravel, meet GraphQL.
LaraQL enables you to effortlessly integrate GraphQL into your Laravel application using native PHP attributes. Published in 2025 for modern developer workflows.
LaraQL uses Code-First Discovery. Instead of maintaining a separate .graphql file, your PHP classes become the source of truth. LaraQL scans these classes and generates the SDL for Lighthouse on the fly.
Installation
Use composer to add LaraQL to your Laravel project:
composer require nodesol/laraql
Configuration
Publish the default configuration to customize scan paths.
php artisan vendor:publish --tag="laraql-schema"
Basic Usage
The #[Model()] attribute tells LaraQL that this class should be part of the GraphQL schema.
LaraQL will automatically generate the necessary schema to create a Type, Input,
two Queries (single/multiple), and Mutations (create/update/delete).
use Nodesol\LaraQL\Attributes\Model;
#[Model]
class Article extends Model
{
public string $title;
}
Powered by Lighthouse PHP
LaraQL uses the Lighthouse PHP engine to handle query execution. We provide the attribute-based discovery; they provide the world-class execution engine.
Learn more about Lighthouse