elkady/activity-logger

A Laravel package for logging auths activities.

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/elkady/activity-logger

v1.2.0 2026-01-03 14:12 UTC

This package is not auto-updated.

Last update: 2026-02-28 19:49:52 UTC


README

A Laravel package for automatically logging authenticated users' actions (create, update, delete) on configured models.

Features

  • 🔄 Automatic Logging via Laravel Observers — no manual calls required
  • ⚙️ Configurable — choose which models to track
  • 🔗 Polymorphic Relations — works with multiple auth models
  • 🛠 Easy Integration — install, configure, done
  • 🚫 No Modification Needed for target models

Installation

Install the package via Composer:

composer require elkady/activity-logger

After installation you have to publish the config file

php artisan vendor:publish --provider="Elkady\ActivityLogger\ActivityLoggerServiceProvider" --tag=config

This will create a config file at:

config/activity-logger.php

then you have to migrate the added database:

php artisan migrate

Usage :

In any auth model you want to follow steps you have to use the HasActivityLogs like

use Elkady\ActivityLogger\Traits\HasActivityLogs;
class User extends Authenticatable
{
    use HasActivityLogs;
}

Update the Config File

In config/activity-logger.php, list the models you want to track: for example

return [
    'targets' => [
        App\Models\Post::class,
        App\Models\Order::class,
    ],

    'log_actions' => ['created', 'updated', 'deleted'],
];