kamrul-haque/laravel-model-log

Log model events with data by simply adding a Trait

v1.0.1 2022-12-11 09:49 UTC

This package is auto-updated.

Last update: 2024-09-11 13:36:06 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License GitHub Repo stars

Log model events with data by simply adding a Trait

Installation

Install the package via composer:

composer require kamrul-haque/laravel-model-log

Migrate the necessary database tables:

php artisan migrate

Usage

  • Add KamrulHaque\LaravelModelLog\Traits\Loggable Trait to the Model you want to log
  • Access the logs by /model-logs uri added to your application by the package
  • To customize the log view, publish package views:
php artisan vendor:publish --provider="KamrulHaque\LaravelModelLog\ModelLogServiceProvider" --tag="views"