shipu/settings
Composer 安装命令:
composer require shipu/settings
包简介
Settings is persistent settings in laravel
README 文档
README
Persistent settings in Laravel
Features
- Settings
Installation
Setting is a Laravel package so you can install it via Composer. Run this command in your terminal from your project directory:
composer require shipu/settings
Now run this command in your terminal to publish this package resources:
php artisan vendor:publish --provider="Shipu\Settings\Providers\SettingsServiceProvider"
If you run vendor:publish then you have add below code in your settings model
protected $table = 'site_settings'; // you can change your database table name. public $timestamps = false;
Use Traits
Use GetSettings traits in your model.
API List
getAll
For getting all settings value paired by key you can use all method.
YourSettingModel::getAll(); // return collection
set
For set value you can use set method.
YourSettingModel::set('key', 'value'); // return null
Multiple data store by key
YourSettingModel::set(['key1' => 'value', 'key2' => ['subkey2' => 'value-of-subkey2'] ]); // return null
get
For get value you can use get method.
YourSettingModel::get('key'); // return collection or string or null
Fallback Support:
YourSettingModel::get('key2.subkey2'); // return collection or string or null
You can also getting all setting value
YourSettingModel::get(); // return collection
has
For checking key exists or not you can use has method.
YourSettingModel::has('key'); // return bool
Multiple key Forget:
YourSettingModel::has(['key1', 'key2']); // return collection
forget
For delete key you can use forget method.
YourSettingModel::forget('key'); // return integer 0 or 1
Multiple key Forget:
YourSettingModel::forget(['key1', 'key2']); // return interger - how many key successfully delete.
shipu/settings 适用场景与选型建议
shipu/settings 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 181 次下载、GitHub Stars 达 6, 最近一次更新时间为 2018 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Settings」 「lumen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 shipu/settings 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shipu/settings 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 shipu/settings 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Persistent settings package for Laravel framework.
Testing Suite For Lumen like Laravel does.
A Zend Framework module to quickly and easily set PHP settings.
Settings Card for Laravel Nova.
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
Class to generate a standard structure for api json responses
统计信息
- 总下载量: 181
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-18