PHPackages                             sdkwala/laravel-activity-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. sdkwala/laravel-activity-logger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

sdkwala/laravel-activity-logger
===============================

A Laravel package to log model events (created, updated, deleted) to a database table with hybrid model registration.

v1.0.0(9mo ago)21MITPHPPHP ^8.1CI passing

Since Aug 8Pushed 9mo agoCompare

[ Source](https://github.com/sdkwala/laravel-activity-logger)[ Packagist](https://packagist.org/packages/sdkwala/laravel-activity-logger)[ RSS](/packages/sdkwala-laravel-activity-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Activity Logger
=======================

[](#laravel-activity-logger)

A Laravel package to log model events (created, updated, deleted) to a database table, with hybrid model registration.

[![Tests](https://github.com/sdkwala/laravel-activity-logger/workflows/Tests/badge.svg)](https://github.com/sdkwala/laravel-activity-logger/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/6ef8b342e9d5cb74e02cfa2e27c0b45b0691bbcec1d03e46467627d001accc8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73646b77616c612f6c61726176656c2d61637469766974792d6c6f676765722e737667)](https://packagist.org/packages/sdkwala/laravel-activity-logger)[![Total Downloads](https://camo.githubusercontent.com/318a2eff87cfa034445aff3e25b381f5232deb7f860f079a2a57022140ab0895/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73646b77616c612f6c61726176656c2d61637469766974792d6c6f676765722e737667)](https://packagist.org/packages/sdkwala/laravel-activity-logger)

Features
--------

[](#features)

- ✅ **Hybrid Model Registration**: Use trait or config file to register models
- ✅ **Event Logging**: Log created, updated, and deleted events
- ✅ **Flexible Configuration**: Customize events and retention periods
- ✅ **Cleanup Command**: Remove old logs automatically
- ✅ **Laravel 9, 10, 11, 12 Support**: Compatible with multiple Laravel versions
- ✅ **PHP 8.1+ Support**: Modern PHP features

Installation
------------

[](#installation)

```
composer require sdkwala/laravel-activity-logger
```

Publish Config &amp; Migration
------------------------------

[](#publish-config--migration)

```
php artisan vendor:publish --provider="Sdkwala\ActivityLogger\ActivityLoggerServiceProvider"
php artisan migrate
```

Usage
-----

[](#usage)

### 1. Using the Trait

[](#1-using-the-trait)

Add the trait to any Eloquent model:

```
