concept24/nova-settings-tool 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

concept24/nova-settings-tool

最新稳定版本:v1.0.4

Composer 安装命令:

composer require concept24/nova-settings-tool

包简介

A Laravel Nova tool to manage application settings. Fork of bakerkretzmar/nova-settings-tool with Password field support.

README 文档

README

A Laravel Nova 5 tool to manage application settings, stored as JSON via spatie/valuestore.

Forked from bakerkretzmar/nova-settings-tool with additional field types.

What's different from the original

  • Password field type -- values are stored as plain text and masked in the UI
  • Nova 5 compatible -- implements the required menu() method
  • Namespace -- Concept24\NovaSettingsTool

Requirements

  • PHP >= 8.1
  • Laravel Nova >= 5.0
  • spatie/valuestore >= 1.3

Installation

composer require concept24/nova-settings-tool

Publish the config file:

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

Register the tool in NovaServiceProvider:

use Concept24\NovaSettingsTool\SettingsTool;

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

Configuration

Settings are defined in config/nova-settings-tool.php:

return [
    'path' => storage_path('app/settings.json'),
    'sidebar-label' => 'Settings',
    'title' => 'Settings',

    'settings' => [
        [
            'key' => 'site_name',
            'label' => 'Site Name',
        ],
        [
            'key' => 'api_secret',
            'label' => 'API Secret',
            'type' => 'password',
            'panel' => 'API',
        ],
        [
            'key' => 'maintenance',
            'label' => 'Maintenance Mode',
            'type' => 'toggle',
            'help' => 'Enable maintenance mode on the frontend.',
        ],
    ],
];

Available field types

TypeDescription
textSingle-line text input (default)
textareaMulti-line text input
toggleBoolean toggle switch
selectDropdown select (requires options key)
numberNumeric input
codeCodeMirror editor (optional language key)
passwordPassword input, stored as plain text, masked on read

Setting options

KeyRequiredDescription
keyYesUnique identifier, used as the storage key
typeNoField type (default: text)
labelNoDisplay label (default: ucfirst of key)
helpNoHelp text below the field (supports HTML)
placeholderNoInput placeholder text
panelNoGroup settings into named panels
optionsNoKey-value pairs for select type
languageNoCodeMirror language mode for code type

Reading settings

use Spatie\Valuestore\Valuestore;

$store = Valuestore::make(storage_path('app/settings.json'));

$store->get('site_name');
$store->get('maintenance', false);

Events

A Concept24\NovaSettingsTool\Events\SettingsChanged event is fired every time settings are saved, with both the new and previous values.

License

MIT. Original work by Jacob Baker-Kretzmar.

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固