A Laravel Nova tool for editing custom settings using native Nova fields.
deeplookcode/nova-settings is a Laravel package for a laravel nova tool for editing custom settings using native nova fields..
It currently has 0 GitHub stars and 124 downloads on Packagist (latest version 1.1.2).
Install it with composer require deeplookcode/nova-settings.
Discover more Laravel packages by deeplookcode
or browse all Laravel packages to compare alternatives.
Last updated
This Laravel Nova package allows you to create custom settings in code (using Nova's native fields) and creates a UI for the users where the settings can be edited.

Install the package in a Laravel Nova project via Composer:
composer require optimistdigital/nova-settings
Publish the database migration(s) and run migrate:
php artisan vendor:publish --provider="OptimistDigital\NovaSettings\ToolServiceProvider" --tag="migrations"
php artisan migrate
Register the tool with Nova in the tools() method of the NovaServiceProvider:
// in app/Providers/NovaServiceProvider.php
public function tools()
{
return [
// ...
new \OptimistDigital\NovaSettings\NovaSettings
];
}
Define the fields in your NovaServiceProvider's boot() function by calling NovaSettings::setSettingsFields().
\OptimistDigital\NovaSettings\NovaSettings::setSettingsFields([
Text::make('Some setting', 'some_setting'),
Number::make('A number', 'a_number'),
]);
If you want the value of the setting to be formatted before it's returned, pass a Closure as the second parameter to the setSettingsFields function. The function receives two arguments: key and value.
\OptimistDigital\NovaSettings\NovaSettings::setSettingsFields([
// ... fields
], function ($key, $value) {
if ($key === 'some_boolean_value') return boolval($value);
return $value;
});
Call nova_get_settings() to get all the settings formated as a regular array.
To get a single setting's value, call nova_get_setting_value('some_setting_key'). It will return either a value or null if the key is missing.