承接 pxpm/backpack-crud-settings 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

pxpm/backpack-crud-settings

Composer 安装命令:

composer require pxpm/backpack-crud-settings

包简介

Allow developers to add settings into CRUD

README 文档

README

Create settings dashboards to your Backpack application.

bp_settings_main

Instalation:

composer require pxpm/backpack-crud-settings

  • Migrate the settings table: php artisan db:migrate

Publish the config file php artisan vendor:publish --provider="Pxpm\BpSettings\BpSettingsServiceProvider" --tag=config

Create a seeder that will seed your settings into database:

php artisan make:seeder SettingsSeeder

IMPORTANT NOTE

This seeder will be the only source of truth for your settings. This is the way you can add/delete/update settings from database.

The above command will generate something like this in your Database\Seeds\ folder by default in Laravel application.

<?php

use Illuminate\Database\Seeder;

class SettingsSeeder extends Seeder
{
    public function run()
    {
        //create your array of settings like defining Backpack fields.
        $settings = [
             [
                'name' => 'company_name',
                'type' => 'text',
                'label' => 'Company Name',
                'tab' => 'Main',
                'wrapperAttributes' => ['class' => 'col-md-6 form-group']
            ]
        ];
        
        //call the setting manager to manage those settings. It will take care of create/update/delete settings.
        app('settingsmanager')->create($settings);
    }
NOTES:
  • After creating your seeder you should composer dump-autoload

  • Seed the settings with: php artisan db:seed --class=SettingsSeeder

Configuration

If you follow all the instalation steps you should now have an bpsettings.php file in your config/ directory. The default config is ready to work out-of-box, but you are free to customize it the way you want.

Creating settings

You can now access your settings panel in: your_url.com/backpack_admin_prefix/bp-settings

To add settings to your panels like described above you should create an array of Backpack fields and pass them to the Settings Manager. There are some key points in setting definition that you can use to better organize your setting panels.

namespace

By default the settings namespace is null, that means it's a general setting and will appear in the main settings panel. By defining settings namespaces you can create aditional setting panels.

If you setup some settings with namespace => 'users' those settings will be available separately in: your_url.com/backpack_admin_prefix/bp-settings/users

group

Allow you to group settings further inside the panel. You can use tab provided in Backpack with conjunction with group.

validation

You can validate your settings inputs using regular laravel validation.

Define the key validation => 'required|min:5' and we will run your setting input against the laravel validator and return any errors found.

Using settings

  • All settings are pushed into config array on run-time. We use cache mechanism to make sure we don't query the database if there are no changes to settings and just grab the cached version.

You can get the values of non namespaced settings with: config('bpsettings.setting_name) or app('settingsmanager)->get('setting_name') To get namespaced setting value you can do it with: config('bpsettings.namespace.setting_name) or app('settingsmanager)->get('namespace.setting_name')

IMPORTANT NOTE:

This is still a work in progress, i cannot guarantee 100% flawless work.

pxpm/backpack-crud-settings 适用场景与选型建议

pxpm/backpack-crud-settings 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 89 次下载、GitHub Stars 达 8, 最近一次更新时间为 2020 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 pxpm/backpack-crud-settings 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-22