combindma/laravel-option
Composer 安装命令:
composer require combindma/laravel-option
包简介
A key-value storage for laravel
README 文档
README
This package uses spatie valuestore under the hood.
About Combind Agency
Combine Agency is a leading web development agency specializing in building innovative and high-performance web applications using modern technologies. Our experienced team of developers, designers, and project managers is dedicated to providing top-notch services tailored to the unique needs of our clients.
If you need assistance with your next project or would like to discuss a custom solution, please feel free to contact us or visit our website for more information about our services. Let's build something amazing together!
Installation
You can install the package via composer:
composer require combindma/laravel-option
You can publish the config file with:
php artisan vendor:publish --tag="laravel-option-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Default disk |-------------------------------------------------------------------------- | | This is the default disk that will be used to store the options file. | */ 'disk' => 'local', /* |-------------------------------------------------------------------------- | Default filename |-------------------------------------------------------------------------- | | This is the default filename for the options file. | */ 'filename' => 'options.json', ];
Usage
This package makes it easy to store and retrieve some loose values. Stored values are saved as a json file.
It can be used like this:
option()->put('key', 'value'); option()->get('key'); // Returns 'value' option()->has('key'); // Returns true // Specify a default value for when the specified key does not exist option()->get('non existing key', 'default') // Returns 'default' option()->put('anotherKey', 'anotherValue'); // Put multiple items in one go option()->put(['ringo' => 'drums', 'paul' => 'bass']); option()->all(); // Returns an array with all items option()->forget('key'); // Removes the item option()->flush(); // Empty the entire options option()->flushStartingWith('somekey'); // remove all items whose keys start with "somekey" option()->increment('number'); // option()->get('number') will return 1 option()->increment('number'); // option()->get('number') will return 2 option()->increment('number', 3); // option()->get('number') will return 5 // Option implements ArrayAccess option()['key'] = 'value'; option()['key']; // Returns 'value' isset(option()['key']); // Return true unset(option()['key']); // Equivalent to removing the value
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
combindma/laravel-option 适用场景与选型建议
combindma/laravel-option 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 219 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「combindma」 「laravel-option」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 combindma/laravel-option 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 combindma/laravel-option 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 combindma/laravel-option 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Meta pixel integration for Laravel
Laravel package to communicate with the CMI payment plateform
A Laravel package for tracking popular entries(by Models) of a website in a certain time
A simple package for tracking user activities on your Laravel website.
Laravel Twillio SMS API Integration
Alfabank REST API integration
统计信息
- 总下载量: 219
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-29