PHP code example of illuminatech / nova-config

1. Go to this page and download the library: Download illuminatech/nova-config 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/ */

    

illuminatech / nova-config example snippets




namespace App\Providers;

use Illuminatech\Config\Providers\AbstractPersistentConfigServiceProvider;

class PersistentConfigServiceProvider extends AbstractPersistentConfigServiceProvider
{
    protected function items(): array
    {
        return [
            'app.name' => [
                'label' => __('Application name'),
                'rules' => ['sometimes', '  // ...
        ];
    }

    // ...
}



return [
    // ...
    'providers' => [
        // ...
        App\Providers\PersistentConfigServiceProvider::class,
    ],
    // ...
];



namespace App\Providers;

use Laravel\Nova\NovaApplicationServiceProvider;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    public function tools()
    {
        return [
            new \Illuminatech\NovaConfig\NovaConfig(),
            // ...
        ];
    }
}



namespace App\Providers;

use Illuminatech\Config\Providers\AbstractPersistentConfigServiceProvider;

class PersistentConfigServiceProvider extends AbstractPersistentConfigServiceProvider
{
    protected function items(): array
    {
        return [
            'app.name' => [
                'label' => __('Application name'),
                'rules' => ['sometimes', '         'rules' => ['sometimes', '  ],
            'app.description' => [
                'label' => __('Application description'),
                'rules' => ['sometimes', '



namespace App\Providers;

use Laravel\Nova\NovaApplicationServiceProvider;

class NovaServiceProvider extends NovaApplicationServiceProvider
{
    public function tools()
    {
        return [
            (new \Illuminatech\NovaConfig\NovaConfig())
                ->canSee(function ($request) {
                    return $request->user(config('nova.guard'))->is_super_admin;
                }),
            // ...
        ];
    }
}

php artisan vendor:publish --provider="Illuminatech\NovaConfig\NovaConfigServiceProvider" --tag=lang