定制 samuell/revisions-plugin 二次开发

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

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

samuell/revisions-plugin

最新稳定版本:1.2.1

Composer 安装命令:

composer require samuell/revisions-plugin

包简介

Revisions allows to extend any model with Revisionable trait with more features and easy to use.

README 文档

README

Revisions allows to extend any model with Revisionable trait. It offers more features and are easy to use.

Extends OctoberCMS core trait Revisionable: https://octobercms.com/docs/database/traits#revisionable

https://octobercms.com/plugin/samuell-revisions

Usage

Extending model with Revisions trait.

class MyModel {
    use \Samuell\Revisions\Traits\Revisions;

    /**
     * @var array Monitor these attributes for changes.
     */
    protected $revisionable = ['name', 'email'];

}

Adding new widget to our form config

history:
    label: History of changes
    span: full
    disabled: true
    type: revisionhistory
    recordsPerPage: 10
    readOnly: false

Displaying a changed relation

By default, when you make a relation revisionable, only the changed ID will be displayed. To display the title or name of the relation instead, you can add the field below to the parent form.

category_id:
    hidden: true
    revisions:
        relation: Acme\Plugin\Models\Category
        nameFrom: name # 'name' is the default

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 5
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-19