Git Product home page Git Product logo

nova-settings's Introduction

Nova Settings

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 by using akaunting/setting package.

Installation

Install the package in a Laravel Nova project via Composer:

composer require epigra/nova-settings

To publish the database migration(s) configuration of akaunting/setting

php artisan vendor:publish --tag=setting
php artisan vendor:publish --tag=nova-settings
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 \Epigra\NovaSettings\NovaSettingsTool
    ];
}

Usage

Registering fields

Define the fields in your NovaServiceProvider's boot() function by calling NovaSettings::addSettingsFields().

\Epigra\NovaSettings\NovaSettingsTool::addSettingsFields([
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number')
]);

// OR

// Using a callable
\Epigra\NovaSettings\NovaSettingsTool::addSettingsFields(function() {
  return [
    Text::make('Some setting', 'some_setting'),
    Number::make('A number', 'a_number'),
  ];
});

Configuration

reload_page_on_save

This feature is turned off per default. You may turn it on by changing reload_page_on_save value from false to true under config/nova-settings.php to reload the entire page on save. Useful when updating any Nova UI related settings.

Credits

Thanks for the inspiration.

akaunting/setting

You can visit https://github.com/akaunting/setting to get more information on how to use getters/setters and facade of settings package.

optimistdigital/nova-settings

This package is inspired by optimistdigital/nova-settings

nova-settings's People

Contributors

akingundogdu avatar jnbn avatar kosmonowt avatar serkanerip avatar serkansahinn avatar v-bubar 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.