PHPackages                             petecoop/laravel-actions-lighthouse - 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. petecoop/laravel-actions-lighthouse

ActiveLibrary[API Development](/categories/api)

petecoop/laravel-actions-lighthouse
===================================

v2.0.0(3y ago)35652MITPHP

Since Apr 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/petecoop/laravel-actions-lighthouse)[ Packagist](https://packagist.org/packages/petecoop/laravel-actions-lighthouse)[ RSS](/packages/petecoop-laravel-actions-lighthouse/feed)WikiDiscussions main Synced 3w ago

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

Laravel Actions Lighthouse
==========================

[](#laravel-actions-lighthouse)

Create Actions with [Laravel Actions](https://laravelactions.com/) that are resolved by [Lighthouse](https://lighthouse-php.com/) allowing a GraphQL query/mutation to hit an action directly.

Install
-------

[](#install)

```
composer require petecoop/laravel-actions-lighthouse

```

GraphQL Actions
---------------

[](#graphql-actions)

Add the `AsGraphQL` trait to your action:

```
use Petecoop\LaravelActionsLighthouse\AsGraphQL;

class SomeAction
{
    use AsAction, AsGraphQL;
}
```

This is resolved based on name of the query in your schema.graphql:

```
type Query {
    someAction: SomeResult
}
```

Ensure you register the path to the handler in `config/lighthouse.php` this may need to be published first: `php artisan vendor:publish --tag=lighthouse-config`

If adding a mutation then add to mutations - this needs to be done for each folder of actions

```
[
    'namespaces' => [
        'queries' => [
            'App\\GraphQL\\Queries',
            'App\\Actions',
            'App\\Actions\\User',
        ],
    ]
]
```

You can then use the args from GraphQL directly in your handler:

```
type Mutation {
    updateUserName(id: ID!, name: String!): User!
}
```

The arguments are passed in as named arguments to the handle method:

```
class UpdateUserName
{
    use AsAction, AsGraphQL;

    public function handle(string $id, string $name)
    {
        //...
    }
}
```

Or use `asGraphQL` to pull out args from the graphql query, useful if you want to have more control over the args:

```
class SomeAction
{
    use AsAction, AsGraphQL;

    public function handle(int $userId, string $name)
    {
        //...
    }

    public function asGraphQL($_, $args)
    {
        return $this->handle($args['id'], $args['name']);
    }
}
```

Validation
----------

[](#validation)

You can use [Laravel Action Validation Rules](https://laravelactions.com/2.x/add-validation-to-controllers.html#adding-validation-rules) by using the `@actionValidator` directive.

Add `"Petecoop\\LaravelActionsLighthouse"` to your `config/lighthouse.php`:

```
"directives" => ["App\\GraphQL\\Directives", "Petecoop\\LaravelActionsLighthouse"],
```

for example:

```
type Mutation {
    updateUserName(id: ID!, name: String!): User! @actionValidator
}
```

`rules()`, `getValidationMessages()` and `getValidationAttributes()` currently work.

```
class UpdateUserName
{
    use AsAction, AsGraphQL;

    public function handle(string $id, string $name)
    {
        //...
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'min:3'],
        ];
    }
}
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

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

Every ~221 days

Total

4

Last Release

1226d ago

Major Versions

v1.2.0 → v2.0.02023-02-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1655361?v=4)[Pete Cooper](/maintainers/petecoop)[@petecoop](https://github.com/petecoop)

---

Top Contributors

[![petecoop](https://avatars.githubusercontent.com/u/1655361?v=4)](https://github.com/petecoop "petecoop (13 commits)")[![tommica](https://avatars.githubusercontent.com/u/1391027?v=4)](https://github.com/tommica "tommica (1 commits)")

### Embed Badge

![Health badge](/badges/petecoop-laravel-actions-lighthouse/health.svg)

```
[![Health](https://phpackages.com/badges/petecoop-laravel-actions-lighthouse/health.svg)](https://phpackages.com/packages/petecoop-laravel-actions-lighthouse)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M96](/packages/dedoc-scramble)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[neuron-core/neuron-laravel

Official Neuron AI Laravel SDK.

11337.8k1](/packages/neuron-core-neuron-laravel)[lettermint/lettermint-laravel

Official Lettermint driver for Laravel

1190.2k1](/packages/lettermint-lettermint-laravel)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
