定制 smorken/settings 二次开发

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

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

smorken/settings

最新稳定版本:v11.0.2

Composer 安装命令:

composer require smorken/settings

包简介

Settings helper for Laravel

README 文档

README

License

This software is open-sourced software licensed under the MIT license

The Laravel framework is open-sourced software licensed under the MIT license

Requirements

Installation

  • add to your Laravel app composer.json
"require": {
    "smorken/settings": "^6.0"
}
  • composer update

Service Provider should auto register itself. If not:

  • add service provider to config/app.php
'providers' => [
...
    \Smorken\Settings\ServiceProvider::class,
  • publish any needed files
$ php artisan vendor:publish --provider="Smorken\Settings\ServiceProvider" --tag=config #view and config available
  • run the migrations
$ php artisan migrate

Use

app(Smorken\Settings\Contracts\Storage\Setting::class) provides an instance of Smorken\Settings\Contracts\Storage\Setting

setting() is a shortcut for the same

Smorken\Settings\Facades\Setting::class is a facade accessor

Get a setting value:

$s = app(Smorken\Settings\Contracts\Storage\Setting::class);
$value = $s->get('foo.key');

$value = setting('foo.key', 'default_value');

$value = \Smorken\Settings\Facades\Setting::get('foo.key', 'default_value');

Set a settings value (shortcut):

$s = app(Smorken\Settings\Contracts\Storage\Setting::class);
$s->set('foo.key', 'value');

setting()->set('foo.key', 'value');

\Smorken\Settings\Facades\Setting::set('foo.key', 'value');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-20