Search by

nodesol / laraql

amermchaudhary

This is my package laraql

Package info

github.com/nodesol/laraql

pkg:composer/nodesol/laraql

Fund package maintenance!

nodesol

Statistics

Installs: 4 392

Dependents: 0

Suggesters: 0

Stars: 8

Open Issues: 4

v1.0.16 2026-09-16 17:17 UTC

This package is auto-updated.

Last update: 2026-09-19 15:12:05 UTC


README

Laravel, meet GraphQL.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

Documentation

https://nodesol.github.io/laraql

Installation

Use composer to add LaraQL to your Laravel project:

composer require nodesol/laraql

Publish the default configuration to customize scan paths.

php artisan vendor:publish --tag="laraql-schema"

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 as ModelAttribute;

#[ModelAttribute()]
class Article extends Model
{
    public string $title;
}

AI Agents (Laravel Boost)

LaraQL ships Laravel Boost guidelines and agent skills, so coding agents extend the schema with attributes instead of hand-written SDL.

composer require laravel/boost --dev
php artisan boost:install

Boost detects nodesol/laraql and installs:

  • Guidelines (always loaded): how LaraQL discovers classes, what #[Model()] generates, and the rules around $fillable, $hidden, schema caching, database introspection and overrides.
  • Skills (loaded on demand):
    • laraql-development - models, attributes, generated CRUD, filters, overrides, authorization and schema debugging, plus references/attributes.md and references/troubleshooting.md.
    • laraql-scout-search - the @scoutFilters directive for Meilisearch search combined with Eloquent where conditions and pagination.

Both live in resources/boost, so you can read them or copy them into your application's .ai/guidelines and .ai/skills directories to adapt them.

Testing

The suite runs on Testbench with a workbench application in workbench that provides the models, GraphQL classes, migrations and hand-written graphql/schema.graphql the tests exercise.

composer test        # run the whole suite
composer test-coverage
composer analyse     # PHPStan
composer format      # Pint

The tests are split into two suites:

  • tests/Unit - the LaraQL attributes, the schema building listener, the column and relation type maps, and the Scout filters directive/handler.
  • tests/Feature - the schema LaraQL generates (printed and executed), the generated queries and mutations, Scout search, authorization and the service provider behaviour.

Pest reads its configuration from testbench.yaml.dist; copy it to testbench.yaml to change the workbench set-up locally. Coverage reporting needs a driver such as PCOV or Xdebug:

vendor/bin/pest --coverage --min=100

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.