定制 djunehor/laravel-revert-query 二次开发

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

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

djunehor/laravel-revert-query

Composer 安装命令:

composer require djunehor/laravel-revert-query

包简介

Log all model events and revert specific model event

README 文档

README

CircleCI Latest Stable Version Total Downloads License StyleCI Build Status Scrutinizer Code Quality Code Coverage

Laravel Model Event Logger and Revert logs every action on a model (create, delete, update), provides an interface to see the list of all activities as well as revert specific model event.

Installation

Step 1

You can install the package via composer:

composer require djunehor/laravel-revert-query

Laravel 5.5 and above

The package will automatically register itself, so you can start using it immediately.

Laravel 5.4 and older

In Laravel version 5.4 and older, you have to add the service provider in config/app.php file manually:

'providers' => [
    // ...
    Djunehor\EventRevert\EventRevertServiceProvider::class,
];

Lumen

After installing the package, you will have to register it in bootstrap/app.php file manually:

// Register Service Providers
    // ...
    $app->register(Djunehor\EventRevert\EventRevertServiceProvider::class);
];

Step 2 - Publishing files

  • Run: php artisan vendor:publish --tag=ModelEventLogger This will move the migration file, seeder file and config file to your app.
  • Open config/model-event-logger to set the model name and ID of users allowed to access to model event log routes
  • the ID can be a number or list of comma-separated numbers e.g 1,2,3,4,5

Step 3 - SetUp database

  • Runphp artisan migrate to create the table.

Usage

use Djunehor\EventRevert\ModelEventLogger;`
  • Add use ModelEventLogger to your laravel model

Access Saved model event logs

Endpoint Description
/model-events return all saved model events
/model-events/{log} return all model events of a specific model
/model-event-revert/{id} revert specific model event

Reverting via Console

If you know the specific ID of the event you which you revert, you can run: php artisan model:revert --id=EVENT_ID

Contributing

  • Fork this project
  • Clone to your repo
  • Make your changes and run tests composer test
  • Push and create Pull Request

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固