beaplat/activity 问题修复 & 功能扩展

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

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

beaplat/activity

Composer 安装命令:

composer require beaplat/activity

包简介

Auto activity log for Laravel 5.x

关键字:

README 文档

README

This is an automatic log for Laravel 5, you can use the trait in the model class

Installation

Run the following command to install

composer require beaplat/activity

Open your config/app.php and add the following to the providers array

Beaplat\Activity\ActivityServiceProvider::class,

In the same config/app.php and add the following to the aliases array

'Activity' => Beaplat\Activity\Facades\Activity::class,

Run the command below to publish the migration file

php artisan vendor:publish

Run it with the artisan migrate command

php artisan migrate

Use

<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Beaplat\Activity\ActivityTrait;

class Post extends Model
{
    use ActivityTrait;

    protected $guarded = ['id'];
}

If you use the create update save or delete function, the trait will auto create a log into activities table

For example

User::find(1)->update(['name' => 'admin']);

Notice: You must use the create(), update(), save() or delete() with the class Collection, for example, User::find(1)->update(['name' => 'admin']);

You can not use the Builder object, for example, User::where('id', 1)->update(['name' => 'admin']); Because where() return the Builder object, Builder had not the model event.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固