定制 rinvex/laravel-settings 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rinvex/laravel-settings

最新稳定版本:v1.0.3

Composer 安装命令:

composer require rinvex/laravel-settings

包简介

Rinvex Settings is a Laravel package for setting management. You can add, update, and delete application settings with ease, and use like the detaul Laravel config options. It comes with the ability to override config options on runtime, and supports tenantable features out of the box.

README 文档

README

Rinvex Settings

Rinvex Settings is a Laravel package for setting management. You can add, update, and delete application settings with ease, and use like the detaul Laravel config options. It comes with the ability to override config options on runtime, and supports tenantable features out of the box.

Packagist Scrutinizer Code Quality Travis StyleCI License

Installation

  1. Install the package via composer:

    composer require rinvex/laravel-settings
  2. Publish resources (migrations and config files):

    php artisan rinvex:publish:settings
  3. Execute migrations via the following command:

    php artisan rinvex:migrate:settings
  4. Done!

Usage

It's worth mentioning that this package API is inspired by default Laravel config options, and it goes hand in hand with it.

Accessing Setting Values

You may easily access your setting values using the global setting function from anywhere in your application. The setting values may be accessed using "dot" syntax, which includes the name of the setting group and option you wish to access. A default value may also be specified and will be returned if the setting option does not exist:

$value = setting('meta.description');

// Retrieve a default value if the configuration value does not exist...
$value = config('meta.description', 'Rinvex Settings is a Laravel package for setting management.');

To set configuration values at runtime, pass an array to the config function:

config(['meta.description' => 'You can add, update, and delete application settings with ease, and use like the detaul Laravel config options.']);

More Examples

// Retrieve individual setting
$metaKeywords = setting('meta.keywords');
$metaDescription = setting('meta.description');

// Retrieve individual setting of an overridden config option
$appName = setting(‘app.name’);

// Retrieve group of settings
$meta = setting('meta’);

// Retrieve a default value if the setting value does not exist
$metaAuthor = setting('meta.author', 'Abdelrahman Omran');

// Set runtime setting values
setting(['meta.author' => 'Omranic']);
setting(['new.setting.key’ => Some Value Here!']);

Notes:

  • This package automatically spins through all settings and load them into an IoC collection.
  • It supports setting nesting, tenantable features if available, and config option override as well.
  • It executes early on application booting, which makes all options available for use across the whole app.
  • The underlying class for a setting is basically Laravel Eloquent model, which means you can use it the same intuitive way.

Configuration Caching

To give your application a speed boost, you should cache all of your settings into a single file using the setting:cache Artisan command. This will combine all of the configuration options for your application into a single file which can be quickly loaded by the framework.

You should typically run the php artisan setting:cache command as part of your production deployment process. The command should not be run during local development as settings will frequently need to be changed during the course of your application's development.

Notes:

  • Settings caching is disabled at the moment, until we figure out a way to handle tenantable settings cache, as it dynamically overrides app-wide global settings by nature.

Advanced Usage

Settings can override default config options. Be aware this might change the default behavior of your application if not used wisely.

To override any config option using settings, simply create a new setting with the same key as that config option (example: app.name), then set the override_config attribute to TRUE, set the override value you want to set, and save the setting. Next time your app is booted and you call config('app.name'), it will automatically retrieve the value you set for setting('app.name').

Notes:

  • This override_config feature is not intended to override some of the core config options like db connection details for example, as db connection config options are required and loaded at a very early stage. Be cautious when overriding config options.

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

We want to ensure that this package is secure for everyone. If you've discovered a security vulnerability in this package, we appreciate your help in disclosing it to us in a responsible manner.

Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern, please email us at help@rinvex.com. We'll work with you to make sure that we understand the scope of the issue, and that we fully address your concern. We consider correspondence sent to help@rinvex.com our highest priority, and work to address any issues that arise as quickly as possible.

After a security vulnerability has been corrected, a security hotfix release will be deployed as soon as possible.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2022 Rinvex LLC, Some rights reserved.

rinvex/laravel-settings 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-29