Giter Site home page Giter Site logo

activity-logger's Introduction

Laravel Activity Logger

In one of my personal project I was needed to track model events(created, updated, deleted, restored) etc in database, So this was my purpose to create a package to simply track model events. If you are looking for full featured activity logger, I highly recommend to use this spatie/laravel-activitylog package.

Installation

You can install the package via composer by running this command in your terminal,

composer require minhajul/activity-logger

or

"require": {
    "minhajul/activity-logger": "dev-master"
}

then execute composer update

You can publish the config file by running this command: php artisan vendor:publish

Run php artisan migrate to create related database

Usages

// Add this trait in your model
use RecordsActivity;

// By default package will track 'created', 'updated' , 'deleted', 'restored' events if you want to override events you can add static $recordEvents in model 
protected static $recordEvents = [ 'created', 'updated']

// To fetch model events
$model->activities;

// To fetch activities caused by a specific user
$user->activity;

Contributing

Credits

License

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

activity-logger's People

Contributors

minhajul avatar

Stargazers

Mahmudul Hasan avatar Razib Hossain Shuvo avatar Al Imran Ahmed avatar  avatar

Watchers

James Cloos avatar  avatar

activity-logger's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.