https://github.com/bakerkretzmar/nova-settings-tool
Laravel Nova tool to view and edit application settings.
https://github.com/bakerkretzmar/nova-settings-tool
laravel laravel-nova nova php settings vue
Last synced: 7 months ago
JSON representation
Laravel Nova tool to view and edit application settings.
- Host: GitHub
- URL: https://github.com/bakerkretzmar/nova-settings-tool
- Owner: bakerkretzmar
- License: mit
- Created: 2019-01-11T04:15:29.000Z (almost 7 years ago)
- Default Branch: 2.x
- Last Pushed: 2025-01-13T18:10:23.000Z (11 months ago)
- Last Synced: 2025-05-12T02:59:35.245Z (7 months ago)
- Topics: laravel, laravel-nova, nova, php, settings, vue
- Language: PHP
- Homepage:
- Size: 1.71 MB
- Stars: 166
- Watchers: 3
- Forks: 34
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Nova tool to manage app settings
========================================
[](https://packagist.org/packages/bakerkretzmar/nova-settings-tool)
[](https://packagist.org/packages/bakerkretzmar/nova-settings-tool)
[](https://github.com/bakerkretzmar/nova-settings-tool/actions)
[](https://opensource.org/licenses/MIT)
Store and edit simple app-wide settings right in Nova. Settings are stored as JSON using [`spatie/valuestore`](https://github.com/spatie/valuestore), making them really easy to [pull in and use everywhere else in your app](https://laravel-news.com/global-application-settings).

## Installation
Install the package via Composer in any Laravel app using [Nova](https://nova.laravel.com):
```bash
composer require bakerkretzmar/nova-settings-tool
```
> Nova Settings Tool v2 requires Nova 4—for older versions of Nova, use v1 of this package.
Publish the default configuration file to `config/nova-settings-tool.php`:
```bash
php artisan vendor:publish --tag="nova-settings-tool"
```
Register the tool with Nova in the `tools` method of your `NovaServiceProvider`:
```php
// in app/Providers/NovaServiceProvider.php
use Bakerkretzmar\NovaSettingsTool\SettingsTool;
// ...
public function tools()
{
return [
new SettingsTool,
];
}
```
## Usage
Settings are declared in a `nova-settings-tool.php` config file. This file specifies where settings are stored, what the tool’s title is in Nova’s sidebar, the layout of the settings page, and metadata about the settings themselves.
A [default config file with some helpful examples](config/nova-settings-tool.php) is included as a starting point:
Each item in the `settings` array is rendered as an input with a label and help text, similar to one of Nova’s fields. Settings can also be grouped into panels, to separate them visually.
The settings’ actual values are stored as JSON at the location specified in the config file—`storage/app/settings.json` by default.
There are currently six available setting types:
- `text`: Single-line text input
- `textarea`: Multi-line text input
- `toggle`: Boolean switch
- `code`: [CodeMirror](https://codemirror.net/) text editor
- `number`: Number input
- `select`: Single-select dropdown
All strings in this package, and any you pass to it, can easily be translated using [Laravel’s built-in localization features](https://laravel.com/docs/localization#using-translation-strings-as-keys).
This tool also fires an event any time any settings are changed, with all the old and new settings attached.
## Roadmap
The following features are planned or in development:
- `color` setting type
- `date` setting type
- `file` setting type
- setting validation
---
[CHANGELOG](CHANGELOG.md) • [CONTRIBUTING](CONTRIBUTING.md) • [LICENSE](LICENSE.md)