normanhuth/nova-valuestore-settings

A Laravel Nova tool for editing custom settings using native Nova fields.

Downloads

908

Stars

3

Version

1.0.1

This package has been archived

Nova Valuestore Settings

This Laravel Nova package allow you to edit a config file (JSON) by using valuestore

Requirements

"laravel/nova": "^2.0.11 || ^3.0",
"spatie/valuestore": "^1.0"

Features

  • Settings fields management in code
  • UI for editing settings
  • Rule validation support
  • Supports nova-translatable w/ rule validation

Screenshot

Settings View

Installation

Install the package in a Laravel Nova project via Composer:

composer require normanhuth/nova-valuestore-settings

Register the tool with Nova in the tools() method of the NovaServiceProvider:

// in app/Providers/NovaServiceProvider.php

public function tools()
{
    return [
        // ...
        new \NormanHuth\NovaValuestore\NovaValuestore
    ];
}

Usage

Registering fields

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

        \NormanHuth\NovaValuestore\NovaValuestore::addSettingsFields([
            Text::make('Public Name'),
        ]);

Configuration

The config file can be published using the following command:

php artisan vendor:publish --provider="NormanHuth\NovaValuestore\ToolServiceProvider" --tag="config"

Config options:

    'reload_page_on_save' => false,
    'settings_file'       => config_path('settings.json'),

Password field

    NormanHuth\NovaValuestore\Fields\PlainPassword::make('ass'),

Alternative to opanegro/field-nova-password-show-hide

Install

composer require normanhuth/settings-valuestore-pwd-show-hide:dev-master

Usage:

    NormanHuth\PlainFieldNovaPasswordShowHide\PlainFieldNovaPasswordShowHide::make('ass'),

Localization

The translation file(s) can be published by using the following command:

php artisan vendor:publish --provider="NormanHuth\NovaValuestore\ToolServiceProvider" --tag="translations"

You can add your translations to resources/lang/vendor/nova-settings/ by creating a new translations file with the locale name (ie et.json) and copying the JSON from the existing en.json.

Credits

This Package is a fork of optimistdigital/nova-settings

License

Nova Valuestore Settings and Nova Settings is open-sourced software licensed under the MIT license.

NormanHuth

Author

NormanHuth