All Projects β†’ alkhachatryan β†’ laravel-loggable

alkhachatryan / laravel-loggable

Licence: MIT License
πŸŽ₯ πŸ“½ 🎞 Log your model changes in multiple ways

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-loggable

ctrace-go
Canonical OpenTracing for GoLang
Stars: ✭ 12 (-79.31%)
Mutual labels:  log, logger
PoShLog
πŸ”© PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/
Stars: ✭ 108 (+86.21%)
Mutual labels:  log, logger
react-native-log-ios
React Native iOS standalone logger
Stars: ✭ 37 (-36.21%)
Mutual labels:  log, logger
log
PSR-3 compatible logger
Stars: ✭ 32 (-44.83%)
Mutual labels:  log, logger
spdlog setup
spdlog setup initialization via file configuration for convenience.
Stars: ✭ 68 (+17.24%)
Mutual labels:  log, logger
db-safedelete
Attempts to invoke force delete, if it fails - falls back to soft delete
Stars: ✭ 16 (-72.41%)
Mutual labels:  eloquent, model
missionlog
πŸš€ lightweight logging β€’ supports level based filtering and tagging β€’ weighs in at around 500 bytes
Stars: ✭ 19 (-67.24%)
Mutual labels:  log, logger
l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (-55.17%)
Mutual labels:  log, logger
laravel-route-model-autobinding
THIS PACKAGE HAS BEEN DEPRECATED β€” Automatically bind Eloquent models as route segment variables.
Stars: ✭ 14 (-75.86%)
Mutual labels:  eloquent, model
mongoose-morgan
An npm package for saving morgan log inside MongoDB
Stars: ✭ 14 (-75.86%)
Mutual labels:  log, logger
guzzle-log-middleware
A Guzzle middleware to log request and responses automatically
Stars: ✭ 61 (+5.17%)
Mutual labels:  log, logger
react-native-log-level
Multi level logger for React Native
Stars: ✭ 13 (-77.59%)
Mutual labels:  log, logger
GoogleCloudLogging
Swift (Darwin) library for logging application events in Google Cloud.
Stars: ✭ 24 (-58.62%)
Mutual labels:  log, logger
webpack-log
A logger for the Webpack ecosystem
Stars: ✭ 18 (-68.97%)
Mutual labels:  log, logger
apollo-log
A logging extension for the Apollo GraphQL Server
Stars: ✭ 64 (+10.34%)
Mutual labels:  log, logger
Multiplatform-Log
Kotlin Multi Platform Logger, for android an ios : Logcat & print
Stars: ✭ 49 (-15.52%)
Mutual labels:  log, logger
clue
a extremely high performance log library for android. ι«˜ζ€§θƒ½ηš„Androidζ—₯εΏ—εΊ“
Stars: ✭ 27 (-53.45%)
Mutual labels:  log, logger
log
A simple to use log system, minimalist but with features for debugging and differentiation of messages
Stars: ✭ 21 (-63.79%)
Mutual labels:  log, logger
ptkdev-logger
πŸ¦’ Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+101.72%)
Mutual labels:  log, logger
logt
πŸ–₯️ A colourful logger for the browser
Stars: ✭ 35 (-39.66%)
Mutual labels:  log, logger

Laravel Loggable - Log you model changes

Software License Packagist Version CodeFactor Grade Total Downloads

Laravel Loggable is a package for eloquent models, which will monitor the changes on the models and log. It supports two drivers: File and Database.

Features

  • High-configurable
  • Two drivers (database and file)
  • Possibillity to use two drivers at once
  • Possibillity to select the columns for the model which should be logged
  • Possibillity to select the actions for the model which should be logged (create, edit, delete)
  • Facade-based structure to fetch the logs for specific model
  • Much more

Logs

Installation

Install the package.

composer require alkhachatryan/laravel-loggable

Publish the configuration file

php artisan vendor:publish --tag=loggable

Run migration

php artisan migrate

Configuration

Open the configuration file at /config/loggable.php

Set the driver whhich will log the model changes (can be both). However, it's recommended to use the database driver so you can fetch the logs in the future.

'driver' => 'database' 

That's it!

Usage

class Post extends Model
{
    /** Include the loggable trait */
    use Loggable;
    
    /** Specified actions for this model */
    public $loggable_actions = ['edit', 'create', 'delete'];

    /** Specified fields for this model */
    public $loggable_fields  = ['title', 'body'];

    protected $fillable = ['title', 'body'];
}
Retriving the model logs via Facade
Loggable::model('App\Post');
Retriving the model logs via Model
LoggableModel::whereModelName('App\Post')->orderBy('id', 'DESC')->paginate(10);
Event

You can use the event Alkhachatryan\LaravelLoggable\Events\Logged in pair with your listeners.

Changelog

Please see CHANGELOG for more information what has changed recently.

Todo

Tests!!! Tests!!! Tests!!!

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].