2017 © Pedro Peláez
 

library user-activity-log

User Activity Log for Laravel

image

smartsoftware/user-activity-log

User Activity Log for Laravel

  • Tuesday, November 8, 2016
  • by msantang78
  • Repository
  • 0 Watchers
  • 0 Stars
  • 64 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

User Activity Log for Laravel

logo3.png, (*1)

Installation & configuration

With composer:, (*2)

    $ composer require smartsoftware/user-activity-log

Publish config file:, (*3)

    $ php artisan view:publish smartsoftware/user-activity-log

Run migrations, (*4)

    $ php artisan migrate --package='smartsoftware/user-activity-log'

Add provider to config/app.php providers array, (*5)

'Smartsoftware\UserActivityLog\UserActivityLogServiceProvider'

Log Activity

<?php

// Log activity for current user
UserActivityLog::log('Ticket modify');

// Log activity with attached model instance
$ticket = Ticket::find(15);
UserActivityLog::log('Ticket was edited', $ticket);

// Log activity to custom user
$user = User::find(1);
UserActivityLog::log('Ticket was edited', $ticket, $user);

Retrieving Log

<?php
use UserActivityLog;

// get all logs (lasts first)
$log = UserActivityLog::query()->latest()->get();

// get last 20 logs (lasts first)
$log = UserActivityLog::query()->latest()->take(20)->get();

// get all logs for current user
$log = UserActivityLog::query()->latest()->currentUser()->get();

// get logs related to a model instance
$ticket = Ticket::find(15);
$log = UserActivityLog::query()->latest()->related($ticket)->get();

// get logs related to a model class
$log = UserActivityLog::query()->latest()->related('Ticket')->get();

// and only from current user
$log = UserActivityLog::query()->latest()->related($ticket)->currentUser()->get();

// for other user
$user = User::find(1);
$log = UserActivityLog::query()->latest()->fromUser($user)->get();

Geting log attached object, (*6)

<?php
$log = UserActivityLog::query()->latest()->take(20)->get();
$related_obj = $log[0]->getObject();

Cleaning Logs

<?php
// clean logs older than 60 days
UserActivityLog::clean(60);

The Versions

08/11 2016

v0.1.x-dev

0.1.9999999.9999999-dev

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/11 2016

v0.1.8

0.1.8.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/11 2016

v0.1.7

0.1.7.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/03 2016

dev-master

9999999-dev

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/03 2016

v0.2.2

0.2.2.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/03 2016

v0.2.3

0.2.3.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

08/03 2016

v0.2.1

0.2.1.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

04/03 2016

v0.2.0

0.2.0.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

22/09 2015

v0.1.6

0.1.6.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

11/09 2015

v0.1.5

0.1.5.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

11/09 2015

v0.1.4

0.1.4.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

03/09 2015

v0.1.3

0.1.3.0

User Activity Log for Laravel

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

laravel log activity

03/09 2015

v0.1.2

0.1.2.0

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

27/08 2015

v0.1.1

0.1.1.0

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo

26/08 2015

v0.1.0

0.1.0.0

  Sources   Download

The Requires

 

by Martin Alejandro Santangelo