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

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

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

bab55z/nova-settings-tool

Composer 安装命令:

composer require bab55z/nova-settings-tool

包简介

Settings for Laravel Nova.

关键字:

README 文档

README

This package helps you manage settions in your app. It's based on unisharp/laravel-settings package

Installation

composer require bab55z/nova-settings-tool php artisan publish and choose nova-settings-tool to publish config file (config/novasettings.php)

configuration

Here is a sample configuration with commented lines. The config

'storage' => [
    'disk' => 'public',
],
'translation' =>[
    'default_locale' => 'en',                  // should exists in translation.locales
    'locales' => [                             // locales for translation
        'en' => 'English',
        'pl' => 'Polish',
    ],  
],
'settings' => [
    [
        'tab_name' => 'Main',                  // tab name, settings with no tab name are displayed in "others" tab
        'items' => [                           // settings array
            [
                'key' => 'site-title-1',       // setting key
                'label' => 'Site title 1',     // text, image, boolean
                'type' => 'text',              // text, image, boolean
                'validation' => 'string',      // laravel validation rules
                'default' => 'Default text',         // default value
                // NOTICE : for 'text' setting type with translation enabled,
                // if default value is string, it will
                // be stored in default language defined in translation.default_locale parameter
                // to set default values in different languages, use array instead of string like below
                // 'default' => ['en' => 'Monday', 'fr' => 'Lundi'] use languages keys you defined in translation.locales
                'translate' => false,          // true : enable translation, false disables it (text field only)
                'help' => '',                  // help message or instructions
                'multiline' => false,          // display as text area instead of single line
                'minHeight'  => '',            // sizes for image type setting (frontend validation)
                'maxHeight'  => '',            // sizes for image type setting (frontend validation)
                'minWidth'  => '',             // sizes for image type setting (frontend validation)
                'maxWidth'  => '',             // sizes for image type setting (frontend validation)
            ],
            [
                'key' => 'site-intro-text',    // setting key
                'label' => 'Site intro text',  // text, image, boolean
                'type' => 'text',              // text, image, boolean
                'validation' => '',            // laravel validation rules
                'default' => 'Mini intro',     // default value if
                'translate' => true,           // true : enable translation, false disables it (text field only)
                'help' => 'help text.',        // help message or instructions
                'multiline' => true,           // display as text area instead of single line
                'minHeight'  => '',            // sizes for image type setting (frontend validation)
                'maxHeight'  => '',            // sizes for image type setting (frontend validation)
                'minWidth'  => '',             // sizes for image type setting (frontend validation)
                'maxWidth'  => '',             // sizes for image type setting (frontend validation)
            ],
            [
                'key' => 'site-intro-text-2',    // setting key
                'label' => 'Site intro text 2',  // text, image, boolean
                'type' => 'text',              // text, image, boolean
                'validation' => '',            // laravel validation rules
                'default' => ['en' => 'En text.', 'pl' => 'pl text.', ],     // default value if
                'translate' => true,           // true : enable translation, false disables it (text field only)
                'multiline' => false,           // display as text area instead of single line
                'minHeight'  => '',            // sizes for image type setting (frontend validation)
                'maxHeight'  => '',            // sizes for image type setting (frontend validation)
                'minWidth'  => '',             // sizes for image type setting (frontend validation)
                'maxWidth'  => '',             // sizes for image type setting (frontend validation)
            ],
            [
                'key' => 'site-title-img',
                'label' => 'Site title Image',
                'type' => 'image',
                'validation' => 'string',
                'default' => 'http://example.com/img/image.png',
                'translate' => false,
                'help' => 'required image size : 500px * 500px',
                'minHeight' => 500,
                'maxHeight' => '',
                'minWidth' => 500,
                'maxWidth' => '',
            ],
        ],
    ],
    [
        'tab_name' => 'Home Ads',
        'items' => [
            [
                'key' => 'enable-home-ads-1',
                'label' => 'Enable Home Ads #1',
                'type' => 'boolean',
                'validation' => 'string',
                'default' => true,
                'translate' => false,
                'help' => '',
            ],
            [
                'key' => 'enable-home-ads-2',
                'label' => 'Enable Home Ads #2',
                'type' => 'boolean',
                'validation' => 'string',
                'default' => false,
                'translate' => false,
                'help' => '',
            ],
            [
                'key' => 'home-ads-1',
                'label' => 'Home ads 1',
                'type' => 'text',
                'validation' => 'string',
                'default' => 'Ads Title',
                'translate' => false,
                'help' => '',
            ],
            [
                'key' => 'home-ads-2',
                'label' => 'Home ads 2',
                'type' => 'text',
                'validation' => 'string',
                'default' => 'Ads Title',
                'translate' => false,
                'help' => '',
            ],
        ],
    ],
],

Usage

After settings your settings data in config file, head to the settings menu in Laravel Nova dashoarb and set desired values, use it in your code according to UniSharp/laravel-settings documentation.

bab55z/nova-settings-tool 适用场景与选型建议

bab55z/nova-settings-tool 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 12 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「nova」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 bab55z/nova-settings-tool 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bab55z/nova-settings-tool 我们能提供哪些服务?
定制开发 / 二次开发

基于 bab55z/nova-settings-tool 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-01