Download the PHP package bakerkretzmar/nova-settings-tool without Composer
On this page you can find all versions of the php package bakerkretzmar/nova-settings-tool. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bakerkretzmar/nova-settings-tool
More information about bakerkretzmar/nova-settings-tool
Files in bakerkretzmar/nova-settings-tool
Package nova-settings-tool
Short Description A Laravel Nova tool to manage application settings.
License MIT
Homepage https://github.com/bakerkretzmar/nova-settings-tool
Informations about the package nova-settings-tool
Laravel Nova tool to manage app settings
Store and edit simple app-wide settings right in Nova. Settings are stored as JSON using spatie/valuestore
, making them really easy to pull in and use everywhere else in your app.
Installation
Install the package via Composer in any Laravel app using Nova:
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
:
Register the tool with Nova in the tools
method of your NovaServiceProvider
:
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 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 inputtextarea
: Multi-line text inputtoggle
: Boolean switchcode
: CodeMirror text editornumber
: Number inputselect
: 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.
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 typedate
setting typefile
setting type- setting validation
LICENSE