PHPackages                             mlab817/lighthouse-graphql-permission - 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. mlab817/lighthouse-graphql-permission

AbandonedArchivedLibrary[API Development](/categories/api)

mlab817/lighthouse-graphql-permission
=====================================

Add GraphQL types and mutations for spatie/laravel-permission

1.16.0(5y ago)129MITPHPPHP ^7.3|^8.0

Since Dec 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mlab817/lighthouse-graphql-permission)[ Packagist](https://packagist.org/packages/mlab817/lighthouse-graphql-permission)[ RSS](/packages/mlab817-lighthouse-graphql-permission/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (4)Versions (19)Used By (0)

Lighthouse GraphQL Permission
=============================

[](#lighthouse-graphql-permission)

A composer package for adding GraphQL Types to support spatie/laravel-permission.

Installation
------------

[](#installation)

To install the package, run the following command in your project directory:

```
composer require mlab817/lighthouse-graphql-permission
```

The command will also install the dependencies of the package: `spatie/laravel-permission` and `nuwave/lighthouse`.

Set up
------

[](#set-up)

1. Proceed with setting up spatie/laravel-permission as usual. Add the `Spatie Permission Service Provider` in the `config/app.php` file. Also add the `HasRoles` trait in your User model. Do not forget to publish and run the migration. If you need to modify the config of the package, you may also do so by publishing the package's config file.
2. Add the `\Mlab817\LighthouseGraphQLPermission\Providers\LighthouseGraphQLPermissionServiceProvider::class` in the `config/app.php` file. This will add the service provider of the package to your app. Then, publish the `config` and `schema` files of the package by running `php artisan vendor:publish` and selecting the relevant options.
3. You can now use the package.

Schema
------

[](#schema)

```
type Permission {
  id: ID
  name: String
  guard_name: String
}

type Role {
  id: ID
  name: String
  guard_name: String
}

input CreateRoleInput {
  name: String!
}

input CreatePermissionInput {
  name: String!
}

input GivePermissionToUserInput {
  user_id: ID!
  permission: String!
}

input AssignRoleInput {
  user_id: ID!
  role: String!
}

input GivePermissionToRoleInput {
  user_id: ID!
  permission: String!
}

input RevokePermissionToUserInput {
  user_id: ID!
  permission: String!
}

input RevokePermissionToRoleInput {
  role: String!
  permission: String!
}

type Mutation {
  createRole(input: CreateRoleInput!): Role!
  createPermission(input: CreatePermissionInput!): Permission!
  givePermissionToUser(input: GivePermissionToUserInput!): String
  assignRole(input: AssignRoleInput!): User!
  givePermissionToRole(input: GivePermissionToRoleInput!): String
  revokePermissionToUser(input: RevokePermissionToUserInput!): String
  revokePermissionToRole(input: RevokePermissionToRoleInput!): String
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

18

Last Release

1969d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/db243d1c9fca50031271b5bccf872da39aab126e2f29fd0758dc2cdd1a92f9fd?d=identicon)[mlab817](/maintainers/mlab817)

---

Top Contributors

[![mlab817](https://avatars.githubusercontent.com/u/29625844?v=4)](https://github.com/mlab817 "mlab817 (26 commits)")

---

Tags

spatielaravelgraphqllighthouselaravel-permission

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mlab817-lighthouse-graphql-permission/health.svg)

```
[![Health](https://phpackages.com/badges/mlab817-lighthouse-graphql-permission/health.svg)](https://phpackages.com/packages/mlab817-lighthouse-graphql-permission)
```

###  Alternatives

[joselfonseca/lighthouse-graphql-passport-auth

Add GraphQL types and mutations for login and recover password functionalities

234769.9k1](/packages/joselfonseca-lighthouse-graphql-passport-auth)[yakovenko/laravel-lighthouse-graphql-multi-schema

A Laravel package that provides multi-schema support for Lighthouse GraphQL.

1562.5k](/packages/yakovenko-laravel-lighthouse-graphql-multi-schema)

PHPackages © 2026

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