定制 tonning/metabox 二次开发

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

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

tonning/metabox

最新稳定版本:0.1.4

Composer 安装命令:

composer require tonning/metabox

包简介

Create metaboxes for AdminLTE admin panel

README 文档

README

Installation

First, pull in the package through Composer.

"require": {
    "tonning/metabox": "~0.1"
}

And then, if using Laravel 5.1, include the service provider within app/config/app.php.

'providers' => [
    Tonning\Metabox\MetaboxServiceProvider::class
];

And, for convenience, add a facade alias to this same file at the bottom:

'aliases' => [
    'Metabox' => Tonning\Metabox\MetaboxFacade::class
];

On Eloquent models that uses metaboxes add

/**
 * Serialize the meta data on persist
 *
 * @param $meta
 */
public function setMetaAttribute($meta)
{
    $this->attributes['meta'] = serialize($meta);
}

/**
 * Unserialize the meta data on retrival
 *
 * @param $meta
 * @return mixed
 */
public function getMetaAttribute($meta)
{
    return unserialize($meta);
}

统计信息

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

GitHub 信息

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

其他信息

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