2017 © Pedro Peláez
 

library loggable-models

A package to add log on models so that can be retrieved anytime

image

topix-hackademy/loggable-models

A package to add log on models so that can be retrieved anytime

  • Thursday, November 9, 2017
  • by gab88slash
  • Repository
  • 1 Watchers
  • 0 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 0 % Grown

The README.md

Loggable Models

This package provide a easy way to add a log for a Eloquent entity., (*1)

Installation

composer require topix-hackademy/loggable-models, (*2)

in config/app.php, (*3)

'providers' => [
    ..
    Topix\Hackademy\LoggableModels\Laravel\ServiceProvider::class,
    ..
     ]

then launch, (*4)

php artisan vendor:publish

everything is ready., (*5)

Usage

Set the model you want to log like this, (*6)

class Post extends Eloquent implements ModelLogInterface
{
    use ModelLogTrait;


}

Now on an instance of that model you can use any log method in the logger interface, (*7)

$post->alert($message);

public function emergency($message, array $context = array());
public function alert($message, array $context = array());
public function critical($message, array $context = array());
public function error($message, array $context = array());
public function warning($message, array $context = array());
public function notice($message, array $context = array());
public function info($message, array $context = array());
public function debug($message, array $context = array());

to retrieve the logs you can use the plural form of those methods as get:, (*8)

$post->alerts()

as well as there are the scopes for easy quering the database for every level., (*9)

scopeHasEmergencies()
...

Post::hasEmergencies()->get()

The Versions

09/11 2017

dev-master

9999999-dev

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

09/11 2017

v0.1.1

0.1.1.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

09/11 2017

v0.1

0.1.0.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

22/09 2016

dev-develop

dev-develop

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

22/09 2016

dev-release/0.0.9

dev-release/0.0.9

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

07/09 2016

v0.0.8

0.0.8.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

31/07 2016

v0.0.7

0.0.7.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

31/07 2016

dev-release/0.0.8

dev-release/0.0.8

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

31/07 2016

v0.0.6

0.0.6.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

29/07 2016

v0.0.5

0.0.5.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

29/07 2016

dev-feature/soft_delete

dev-feature/soft_delete

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

28/07 2016

v0.0.4

0.0.4.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

27/07 2016

v0.0.2

0.0.2.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

27/07 2016

dev-feature/test_and_main_release

dev-feature/test_and_main_release

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

27/07 2016

v0.0.3

0.0.3.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash

27/07 2016

v0.0.1

0.0.1.0

A package to add log on models so that can be retrieved anytime

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gab88slash