core45/system-settings-db 问题修复 & 功能扩展

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

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

core45/system-settings-db

最新稳定版本:0.1.5

Composer 安装命令:

composer require core45/system-settings-db

包简介

Get system settings for your Laravel app from database

README 文档

README

Very simple package for storing settings for your Laravel project in the database.

Installation

Install the package with composer:

composer require core45/system-settings-db

Publish the package files:

php artisan vendor:publish --provider="Core45\SystemSettingsDb\SystemSettingsDbServiceProvider" 

Migrate the database:

php artisan migrate 

Usage

After migrating the new table system_settings will be created in the database. The package doesn't provide a UI for managing the settings. You have to add/modify/delete the records on your own. The important columns are:

  • key: the key of the setting
  • value: the value of the setting

The other columns are for your convenience. You can also add your own columns to the table if you like.

Setting a value

In the database you can set a value for a key. The key is a string and the value can be a string, integer or boolean.

To access the value of a key you can use the config() helper function.

config('system-settings.some-key');

So for example in your blade template you can use your contact email you previously stored in the settings table:

My email is: <a href="mailto:{{ config('system-settings.email') }}">{{ config('system-settings.email') }}</a>

Cache

The package uses the Laravel cache so if you'd like to see the changes immediately clean the Laravel cache. Default TTL of the cache is 60 seconds. You can change this setting in the config file.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固