miladev/lara-setting 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

miladev/lara-setting

最新稳定版本:1.0

Composer 安装命令:

composer require miladev/lara-setting

包简介

A laravel package for managing project settings.

README 文档

README

Latest Stable Version License Total Downloads

A laravel package for managing project settings.

We always need to use a settings system in our application. This package will help you to create the system easily. The package will create a table in database named settings with key, value and autoload column. You can specify which column should be loaded in boot time by setting autoload column to true.

Installation

You can install the package via composer:

composer require miladev/lara-setting

If you are using Laravel Package Auto-Discovery, you don't need you to manually add the ServiceProvider.

Without auto-discovery:

If you don't use auto-discovery, add the below ServiceProvider to the $providers array in config/app.php file.

Miladev\LaravelSettings\SettingServiceProvider::class,

Then add the Setting facade in $aliases array in config/app.php file.

'Setting' => \Miladev\LaravelSettings\Facades\Setting::class,

Then you can run migration command to create database table.

php artisan migrate

You can also publish the migration file and modify as you needs.

php artisan vendor:publish --provider="Miladev\LaravelSettings\SettingServiceProvider"

Usage

use Miladev\LaravelSettings\Facades\Setting;

Setting::set('setting_key', 'setting_value', $autoload); // create or update
// Here, $autoload = true if you want to indicate that this should be loaded by default.
Setting::has('setting_key'); // check whether the key exists or not
Setting::get('setting_key', 'default_value'); // get the value
Setting::forget('setting_key'); // remove from the settings table
Setting::clean(); // remove all rows from the settings table
Setting::all(); // get all settings

Roadmap

  • Runtime result cache to reduce duplicate query.
  • Runtime in-memory caching to avoid duplicate queries
  • File and Redis cache drivers
  • Multiple storage drivers (database, file, Redis, custom)
  • Typed values and automatic serialization/deserialization (arrays, JSON)
  • Encryption support for sensitive values
  • Validation rules for keys and values
  • Per-setting expiration / TTL support
  • Import/export (JSON/CSV) of settings
  • Artisan commands for managing settings (list, set, forget, export)
  • Blade directives and helper functions for easy retrieval
  • Events and hooks on create/update/delete

If you want to contribute, open a pull request by following Laravel contribution guide.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固