定制 gigabait93/laravel-settings 二次开发

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

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

gigabait93/laravel-settings

最新稳定版本:v1.0.0

Composer 安装命令:

composer require gigabait93/laravel-settings

包简介

Settings for Laravel.

README 文档

README

A small package for saving and cache settings in Laravel.

Installation

  1. Set the package:

    composer require gigabait93/laravel-settings
  2. Publish Config and Migration (optional):

    php artisan vendor:publish --provider="Gigabait93\LaravelSettings\Providers\LaravelSettingsServiceProvider" --tag=config
    php artisan vendor:publish --provider="Gigabait93\LaravelSettings\Providers\LaravelSettingsServiceProvider" --tag=migrations
  3. Complete the migration:

    php artisan migrate

Використання

Obtaining and setting values:

use Gigabait93\LaravelSettings\Facades\Settings;

Settings::set('site.name', 'My Site');
$name = Settings::get('site.name');

// or helper
sset('items_per_page', 20);
$value = sget('items_per_page');

Managing a group of values:

settings()->setMany([
    'a' => 1,
    'b' => true,
]);

$values = settings()->many(['a', 'b']); // ['a' => 1, 'b' => true]

Cache

The package uses cache to reduce the number of references to the database. Cash setup can be changed in the file config/settings.php:

  • ttl — Storage time in seconds (0 turns off cache).
  • prefix — Key prefix.
  • other parameters describe keys and tags.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-21