定制 beitsafe/laravel-uuid-auditing 二次开发

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

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

beitsafe/laravel-uuid-auditing

最新稳定版本:v2.0.1

Composer 安装命令:

composer require beitsafe/laravel-uuid-auditing

包简介

This package adds Traits for generating UUIDs and filling audit columns on Models, extends fico7489/laravel-pivot to add UUIDs to Pivot Tables

README 文档

README

This package adds Traits for generating UUIDs and filling audit columns on Models, extends fico7489/laravel-pivot to add UUIDs to Pivot Tables

Based On

This package is based on https://github.com/fico7489/laravel-pivot and using webpatser/laravel-uuid

Install

1.Install package with composer

composer require beitsafe/laravel-uuid-auditing:"@dev"

Configure Automatically

  1. Use BeITSafe\Laravel\Models\BeITSafeModel trait in your base model or only in particular models. This will automatically generate UUIDs for BOTH Models and Pivot Tables.
...
use BeITSafe\Laravel\Models\BeITSafeModel;
 
class SomeModel extends BeITSafeModel
{
...

Configure UUIDs Manually

1.Use BeITSafe\Laravel\Traits\Uuids trait in your base model or only in particular models. This will automatically generate UUIDs for BOTH Models and Pivot Tables.

...
use BeITSafe\Laravel\Traits\Uuids;
use Illuminate\Database\Eloquent\Model;

abstract class BaseModel extends Model
{
    use Uuids;
...

Configure Auditing Manually

1.Use BeITSafe\Laravel\Traits\Auditing trait in your base model or only in particular models. This will automatically save the Auth::user()->id to 'created_by', 'updated_by', 'deleted_by' if there is a logged in User and the column exists in the Model.

...
use BeITSafe\Laravel\Traits\Auditing;
use Illuminate\Database\Eloquent\Model;

abstract class BaseModel extends Model
{
    use Auditing;
...

New eloquent events

New events are :

pivotAttaching, pivotAttached
pivotDetaching, pivotDetached,
pivotUpdating, pivotUpdated

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-06