Giter VIP home page Giter VIP logo

nova-settings-tool's Introduction

A Laravel Nova tool to manage app settings

Latest Version on Packagist Total Downloads License: MIT StyleCI

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 in any Laravel app that uses Nova via composer:

composer require bakerkretzmar/nova-settings-tool

Publish the included default configuration file to config/settings.php (optional, see below):

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

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

// in app/Providers/NovaServiceProvider.php

use Bakerkretzmar\SettingsTool\SettingsTool;

// ...

public function tools()
{
    return [
        new SettingsTool,
    ];
}

Usage

Settings can be declared using a settings.php file in your app's config folder. This file lets you specify where your settings are stored, what the tool's title is in Nova's sidebar, the layout of the settings page, and information about the settings themselves.

This package includes a default config file that you can publish and use as a starting point:

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

The default config contains examples that should be pretty self-explanatory, and lots of comments in case they aren't.

Each item in the panels array is rendered as its own 'group' of settings, like a panel on one of Nova's detail views. Each panel has a name and contains some settings. Each setting can optionally have a description and a link to more information (e.g. docs). Only the setting's key and value are actually stored in your settings.json file.

There are three available setting types:

Type... ...displays
toggle Boolean
text Single-line text input
textarea Multi-line text input

All the strings hard-coded in this package (like in the "Save" button), as well as any you pass to it (like the name of any of your settings), can easily be translated using Laravel's built-in localization features.

Testing

composer test

I'm new to testing and would welcome testing-related PRs.

Changelog

Please see the CHANGELOG for information about what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

This package is licensed under the MIT License (MIT). Please see the LICENSE for details.

nova-settings-tool's People

Contributors

bakerkretzmar avatar bomshteyn avatar marceauka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.