PHP code example of epigra / nova-settings

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

    

epigra / nova-settings example snippets


// in app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \Epigra\NovaSettings\NovaSettingsTool
    ];
}

\Epigra\NovaSettings\NovaSettingsTool::addSettingsFields([
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number')
]);

// OR

// Using a callable
\Epigra\NovaSettings\NovaSettingsTool::addSettingsFields(function() {
  return [
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
  ];
});
bash
php artisan vendor:publish --tag=setting
php artisan vendor:publish --tag=nova-settings
php artisan migrate