PHPackages                             roboroads/lighthouse-settings - 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. roboroads/lighthouse-settings

ActiveLibrary[API Development](/categories/api)

roboroads/lighthouse-settings
=============================

A Lighthouse plugin to add settings to your graphql

v1.1.0(3y ago)310MITPHPPHP &gt;=7.4

Since Jun 27Pushed 3y ago1 watchersCompare

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

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

[Lighthouse](https://github.com/nuwave/lighthouse) plugin for [spatie/laravel-settings](https://github.com/Spatie/laravel-settings)
===================================================================================================================================

[](#lighthouse-plugin-for-spatielaravel-settings)

A nice way to make Lighthouse receive and update typed settings from the laravel-settings plugin.

Install
-------

[](#install)

```
composer require roboroads/lighthouse-laravel-settings
```

After installing you might want to re-generate the ide-helper files:

```
php artisan lighthouse:ide-helper
```

Usage
-----

[](#usage)

First, create your settings as normal. Let's say we have the following settings file

```
class GeneralSettings extends Settings
{
    public string $name;
    public string $url;
    public string $description;

    public static function group(): string
    {
        return 'general';
    }
}
```

### Querying settings

[](#querying-settings)

Use @settings to tell Lighthouse to get settings using the same name as the type:

```
type GeneralSettings {
    name: String!
    url: String!
    description: String!
}

type Query {
    generalSettings: GeneralSettings! @settings
}
```

> Note: if your type does not match the pattern `App\Settings\TypeName` (in this case `App\Settings\GeneralSettings`) you can use `@settings(class: "\\Path\\To\\YourSettings")`.

### Mutating settings

[](#mutating-settings)

Use @settings to tell Lighthouse to update settings using the same name as the type:

```
type GeneralSettings {
    name: String!
    url: String!
    description: String!
}

type Mutation {
    updateGeneralSettings(
        name: String!
        url: String!
        description: String!
    ): GeneralSettings! @settings
}
```

> Note: Except for @can, you can use @rules, @trim, etc. like you can when updating models.

### Using @canSettings instead of @can

[](#using-cansettings-instead-of-can)

Since Lighthouse really wants to connect @can to an actual Model, you have to use @canSettings to use the ability to authorize the user for settings.

```
type Mutation {
    updateGeneralSettings(
        name: String!
        url: String!
        description: String!
    ): GeneralSettings! @settings @canSettings(ability: "editSettings")
}
```

```
//Defining a gate
Gate::define('editSettings', function (User $user, string $settingsClass) {
    return $user->isAdmin();
});
```

Optional configuration
----------------------

[](#optional-configuration)

If you want to tweak this plugin you can publish `config/laravel-settings.php` with:

```
php artisan vendor:publish --provider="Roboroads\LighthouseSettings\ServiceProvider"
```

### settings-namespace

[](#settings-namespace)

Change the default namespace this package looks in when searching for settings.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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 ~7 days

Total

2

Last Release

1459d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v1.1.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/roboroads-lighthouse-settings/health.svg)

```
[![Health](https://phpackages.com/badges/roboroads-lighthouse-settings/health.svg)](https://phpackages.com/packages/roboroads-lighthouse-settings)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

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

PHPackages © 2026

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