1. Go to this page and download the library: Download primestst/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/ */
primestst / nova-settings example snippets
// in app/Providers/NovaServiceProvider.php
public function tools()
{
return [
// ...
new \OptimistDigital\NovaSettings\NovaSettings
];
}
// Using an array
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields([
Text::make('Some setting', 'some_setting'),
Number::make('A number', 'a_number'),
]);
// OR
// Using a callable
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields(function() {
return [
Text::make('Some setting', 'some_setting'),
Number::make('A number', 'a_number'),
];
});
// Using an array
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields([
Panel::make('Panel Title', [
Text::make('Some setting', 'some_setting'),
Number::make('A number', 'a_number'),
]),
]);