2017 © Pedro Peláez
 

library activity-log

A clean and simple Laravel 5 activity logger for logging website / application actions.

image

jackjoe/activity-log

A clean and simple Laravel 5 activity logger for logging website / application actions.

  • Thursday, March 1, 2018
  • by jeroenbourgois
  • Repository
  • 3 Watchers
  • 0 Stars
  • 406 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 8 Versions
  • 2 % Grown

The README.md

ActivityLog

Latest Version on Packagist Build Status Scrutinizer Code Quality Total Downloads, (*1)

, (*2)

Installation

Basic installation, service provider registration, and aliasing:

Installation is done with composer, so add the package to yourcomposer.json file:, (*3)

"require": {
    "jackjoe/activity-log": "0.3.*"
},

Then run composer update, (*4)

Laravel 5.5+

Laravel 5.5 has auto discovery, you are done. If not see below., (*5)

<= Laravel 5.4

Register the service provider and alias in app/config/app.php. Add the following to the providers array:, (*6)

JackJoe\ActivityLog\ActivityLogServiceProvider::class,

And add this to the aliases array:, (*7)

'Activity' => JackJoe\ActivityLog\Models\Activity::class,

Publishing migrations and configuration:

To publish this package's configuration, run this from the command line:, (*8)

php artisan vendor:publish --provider="JackJoe\ActivityLog\ActivityLogServiceProvider"

Note: Migrations are only published; remember to run them when ready., (*9)

To run migration to create ActivityLog's table, run this from the command line:, (*10)

php artisan migrate

, (*11)

Basic Usage

Logging user activity:

Activity::log([
  'contentId'   => $user->id,
  'content' => 'User',
  'action'      => 'ACTION',
  'state'       => 'SUCCESS',
  'details'     => 'Username: ' . $user->username,
  'data'        => json_encode($data)
]);

The above code will log an activity for the currently logged in user. The IP address will automatically be saved as well., (*12)

Variable guidelines

  • content: type of content we are dealing with, can be set to match PHP class, controller, model, ... It gives us more context where this action has taken place.
  • contentId (option): id of content, in case of a model
  • action: method name, sub-action in method, ..
  • state: state of action such as ERROR, SUCCESS, WRONG_CODE, ...
  • details: more like meta date about current state
  • data: raw data, fetched content, posted content, ...

Contributing

Please see CONTRIBUTING for details., (*13)

Credits

Based on Regulus/ActivityLog., (*14)

License

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

The Versions

01/03 2018

dev-master

9999999-dev

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels
by Jeroen Bourgois

laravel log user activity jackjoe

01/03 2018

0.3.3

0.3.3.0

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels
by Jeroen Bourgois

laravel log user activity jackjoe

26/02 2018

0.3.2

0.3.2.0

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels
by Jeroen Bourgois

laravel log user activity jackjoe

12/02 2018

0.3.1

0.3.1.0

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels

laravel log user activity jackjoe

12/02 2018

0.3.0

0.3.0.0

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels

laravel log user activity jackjoe

02/06 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels

laravel log user activity jackjoe

02/06 2017

0.2.0

0.2.0.0

A clean and simple Laravel 5 activity logger for logging website / application actions.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pieter Michels

laravel log user activity jackjoe

20/03 2017

0.1.0

0.1.0.0

A clean and simple Laravel 5 activity logger for logging website / application actions. Based on Regulus/ActivityLog

  Sources   Download

MIT

The Requires

 

by Pieter Michels