normanhuth/nova-valuestore-settings

This package is abandoned and no longer maintained. No replacement package was suggested.

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

1.0.1 2020-04-24 07:33 UTC

This package is auto-updated.

Last update: 2022-05-29 02:01:46 UTC


README

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.