2017 © Pedro Peláez
 

library activity

Auto activity log for Laravel 5.x

image

beaplat/activity

Auto activity log for Laravel 5.x

  • Wednesday, July 18, 2018
  • by Beaplat
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

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

Installation

Run the following command to install, (*2)

composer require beaplat/activity

Open your config/app.php and add the following to the providers array, (*3)

Beaplat\Activity\ActivityServiceProvider::class,

In the same config/app.php and add the following to the aliases array, (*4)

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

Run the command below to publish the migration file, (*5)

php artisan vendor:publish

Run it with the artisan migrate command, (*6)

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, (*7)

For example, (*8)

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']);, (*9)

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., (*10)

The Versions

18/07 2018

dev-master

9999999-dev

Auto activity log for Laravel 5.x

  Sources   Download

MIT

The Requires

 

by Avatar Beaplat

laravel log

02/03 2017

1.0.0

1.0.0.0

Auto activity log for Laravel 5.x

  Sources   Download

MIT

The Requires

 

by Avatar Beaplat

laravel log