Skip to content
Laravel Nova tool to view and edit application settings.
PHP JavaScript Vue HTML
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
config 1.0 (#24) Sep 29, 2019
dist 1.0 (#24) Sep 29, 2019
resources 1.0 (#24) Sep 29, 2019
routes 1.0 (#24) Sep 29, 2019
src Apply fixes from StyleCI (#28) Nov 15, 2019
tests 1.0 (#24) Sep 29, 2019
.gitignore 1.0 (#24) Sep 29, 2019
.styleci.yml Don't StyleCI tests Jan 14, 2019
CHANGELOG.md Fix collection merging to hide "Other" section if all settings have a… Nov 15, 2019
CONTRIBUTING.md 1.0 (#24) Sep 29, 2019
LICENSE.md Add info Jan 14, 2019
README.md 1.0 (#24) Sep 29, 2019
composer.json 1.0 (#24) Sep 29, 2019
package.json 1.0 (#24) Sep 29, 2019
phpunit.xml 1.0 (#24) Sep 29, 2019
settings-tool.png 1.0 (#24) Sep 29, 2019
webpack.mix.js 1.0 (#24) Sep 29, 2019

README.md

Laravel Nova tool to manage app settings

Latest Version on Packagist Total Downloads Build StyleCI License: MIT

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.

Settings Tool screenshot

Installation

Install the package via Composer in any Laravel app using Nova:

composer require bakerkretzmar/nova-settings-tool

Publish the default configuration file to config/nova-settings-tool.php:

php artisan vendor:publish --tag="nova-settings-tool"

Register the tool with Nova in the tools method of your NovaServiceProvider:

// 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 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 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.

Roadmap

The following features are planned or in development:

  • color setting type
  • date setting type
  • file setting type
  • setting validation

CHANGELOGCONTRIBUTINGLICENSE

You can’t perform that action at this time.