PHP code example of deeplookcode / nova-settings

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

    

deeplookcode / nova-settings example snippets


// in app/Providers/NovaServiceProvider.php

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

\OptimistDigital\NovaSettings\NovaSettings::setSettingsFields([
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
]);

\OptimistDigital\NovaSettings\NovaSettings::setSettingsFields([
    // ... fields
], function ($key, $value) {
    if ($key === 'some_boolean_value') return boolval($value);
    return $value;
});
bash
php artisan vendor:publish --provider="OptimistDigital\NovaSettings\ToolServiceProvider" --tag="migrations"
php artisan migrate