PHP code example of roboroads / lighthouse-settings

1. Go to this page and download the library: Download roboroads/lighthouse-settings library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

roboroads / lighthouse-settings example snippets


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

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

//Defining a gate
Gate::define('editSettings', function (User $user, string $settingsClass) {
    return $user->isAdmin();
});
bash
php artisan lighthouse:ide-helper
bash
php artisan vendor:publish --provider="Roboroads\LighthouseSettings\ServiceProvider"