2017 © Pedro Peláez
 

library laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

image

yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  • Wednesday, January 3, 2018
  • by yajra
  • Repository
  • 4 Watchers
  • 21 Stars
  • 5,475 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 13 Versions
  • 46 % Grown

The README.md

Laravel Auditable

Latest Version on Packagist ![Software License][ico-license], (*1)

Continuous Integration Static Analysis ![Total Downloads][ico-downloads], (*2)

Laravel Auditable is a simple Laravel auditing package for your Eloquent Model. This package automatically inserts/updates an audit log on your table on who created and last updated the record., (*3)

Laravel Version Compatibility

Laravel Package
5.x-10.x 4.x
11.x 11.x
12.x 12.x

Install via Composer

composer require yajra/laravel-auditable:^12

Publish config file

If you want to modify the withDefault option on auditable columns, you may publish the config file., (*4)

php artisan vendor:publish --tag=auditable

Usage

Update your model's migration and add created_by and updated_by field using the auditable() blueprint macro., (*5)

Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name', 100);
    $table->auditable();
    $table->timestamps();
});

Then use AuditableTrait on your model., (*6)

``` php namespace App;, (*7)

use Yajra\Auditable\AuditableTrait;, (*8)

class User extends Model { use AuditableTrait; }, (*9)


## Soft Deletes If you wish to use Laravel's soft deletes, use the `auditableWithDeletes()` method on your migration instead: ```php Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name', 100); $table->auditableWithDeletes(); $table->timestamps(); $table->softDeletes() });

Afterwards, you need to use AuditableWithDeletesTrait on your model., (*10)

``` php namespace App;, (*11)

use Yajra\Auditable\AuditableWithDeletesTrait;, (*12)

class User extends Model { use AuditableWithDeletesTrait, SoftDeletes; }, (*13)



## Dropping columns You can drop auditable columns using `dropAuditable()` method, or `dropAuditableWithDeletes()` if using soft deletes. ```php Schema::create('users', function (Blueprint $table) { $table->dropAuditable(); });

And you're done! The package will now automatically add a basic audit log for your model to track who inserted and last updated your records., (*14)

Change log

Please see CHANGELOG for more information what has changed recently., (*15)

Testing

bash composer test, (*16)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*17)

Security

If you discover any security related issues, please email aqangeles@gmail.com instead of using the issue tracker., (*18)

Credits

License

The MIT License (MIT). Please see License File for more information., (*19)

The Versions

03/01 2018

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

v2.0.1

2.0.1.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

v2.0.0

2.0.0.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

v1.1.3

1.1.3.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

v1.1.2

1.1.2.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

28/12 2017

dev-master

9999999-dev https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

09/06 2017

v1.1.1

1.1.1.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

05/01 2017

v1.1.0

1.1.0.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

18/11 2016

v1.0.0

1.0.0.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

20/07 2016

0.1.2

0.1.2.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

14/07 2016

0.1.1

0.1.1.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra

13/06 2016

v0.1.0

0.1.0.0 https://github.com/yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel auditable yajra