定制 cupoftea/easycfg 二次开发

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

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

cupoftea/easycfg

最新稳定版本:v1.1.2

Composer 安装命令:

composer require cupoftea/easycfg

包简介

Easily add configuration data to your Eloquent Models or Application in Laravel 5!

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version StyleCI License

EasyCFG

Easily add configuration data to your Eloquent Models or Application in Laravel 5!

EasyCFG is a Configuration Manager for Laravel 5. It provides an easy way to save Configuration and other Metadata.

With EasyCfg, saving data related to other things, wether it is on your Application, a Class or an Object, becomes a simple task. Some use cases are User Settings and dynamic Application Configuration (e.g. in an Admin Panel), but of course you can use this however you like.

Quickstart

$ composer require cupoftea/easycfg ^1.1
// Global data
Cfg::set('key', 'value');
$value = Cfg::get('key');

// Class data
cfg()->set('key', 'value', MyConfigurableCommand::class);
$value = cfg('key', MyConfigurableCommand::class);

// Object data (Class instance)
// where $myobject = {"id": 1, "property": "value"}
cfg()->set('key', 'value', $myObject);
cfg()->set('foo', 'bar', MyConfigurableClass::class, $myObject->id);
$cfg = cfg()->all($myObject);


// Settings in Blade partials

// app.blade.php
<div class="content @cfg('scheme')-scheme">
    @yield('content')
</div>

// page.blade.php
@cfg('scheme', 'dark')
@section('content')
    ...
@endsection

// Rendered HTML
<div class="content dark-scheme">
    ...
</div>

Features

  • Simple access to Configuration Data via the Facade or Helper function.
  • Trait to ease setting data on Models or any other Class.
  • Configurable database table.
  • @cfg Blade directive.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固