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

ActiveLibrary

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

v2.0.0(3y ago)35442MITPHP

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 today

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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

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

1175d ago

Major Versions

v1.2.0 → v2.0.02023-02-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/7bfb05a4659b16939bc3dc697db922e7a08eabd2c9de6fe6bb54bf5ee86a4061?d=identicon)[petecoop](/maintainers/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

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[binary-cats/laravel-rbac

Laravel enum-backed RBAC extension of spatie/laravel-permission

7730.4k](/packages/binary-cats-laravel-rbac)[illuminate/process

The Illuminate Process package.

44699.5k65](/packages/illuminate-process)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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