andrewboy/historylog 问题修复 & 功能扩展

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

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

andrewboy/historylog

Composer 安装命令:

composer require andrewboy/historylog

包简介

Laravel package for Model history logging.

README 文档

README

This is a Laravel 5 package, that can log Model history.

It's under development, not recommended for production use!

Installation

add bundle to composer:

"andrewboy/historylog": "dev-master"

run composer:

composer install / update

add service provider to the providers list:

'Andrewboy\HistoryLog\HistoryLogServiceProvider'

publish config and migration:

php artisan vendor:publish --provider="Andrewboy\HistoryLog\HistoryLogServiceProvider"

run migration:

php artisan migrate

Usage

  1. You have to create a Trait that uses the "HistoryLog" trait and implement the "getUserId" abstract method.
use Andrewboy\HistoryLog\Traits\HistoryLogTrait;

trait MyHistoryLogTrait{

    use HistoryLogTrait;
    
    /**
     * Get the logged users' ID
     * @return integer | null On success user ID
     */
    public function getUserId()
    {
        ...
    }
}
  1. Simply just add the trait to your model
use App\Traits\MyHistoryLogTrait;

class MyModel extends Model
{

    use MyHistoryLogTrait;
    
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-07-15