Download the PHP package roboroads/lighthouse-settings without Composer
On this page you can find all versions of the php package roboroads/lighthouse-settings. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roboroads/lighthouse-settings
More information about roboroads/lighthouse-settings
Files in roboroads/lighthouse-settings
Package lighthouse-settings
Short Description A Lighthouse plugin to add settings to your graphql
License MIT
Informations about the package lighthouse-settings
Lighthouse plugin for spatie/laravel-settings
A nice way to make Lighthouse receive and update typed settings from the laravel-settings plugin.
Install
After installing you might want to re-generate the ide-helper files:
Usage
First, create your settings as normal. Let's say we have the following settings file
Querying settings
Use @settings to tell Lighthouse to get settings using the same name as the type:
Note: if your type does not match the pattern
App\Settings\TypeName(in this caseApp\Settings\GeneralSettings) you can use@settings(class: "\\Path\\To\\YourSettings").
Mutating settings
Use @settings to tell Lighthouse to update settings using the same name as the type:
Note: Except for @can, you can use @rules, @trim, etc. like you can when updating models.
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.
Optional configuration
If you want to tweak this plugin you can publish config/laravel-settings.php with:
settings-namespace
Change the default namespace this package looks in when searching for settings.
All versions of lighthouse-settings with dependencies
nuwave/lighthouse Version >=5
spatie/laravel-settings Version >=2
illuminate/support Version >=8