Download the PHP package alifcoder/activity-log without Composer
On this page you can find all versions of the php package alifcoder/activity-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alifcoder/activity-log
More information about alifcoder/activity-log
Files in alifcoder/activity-log
Package activity-log
Short Description A simple action activity log package for Laravel.
License MIT
Informations about the package activity-log
π Alif Activity Log
A simple, customizable Laravel package to log and store user activity across your application. Perfect for auditing, tracking changes, and monitoring actions within modules.
β¨ Features
- Logs authenticated user actions and request details
- Stores activity in a dedicated
activity_logs
table - Supports parent-child log relationships
- Customizable logging behavior
- Easily extendable and minimalistic
π¦ Requirements
- PHP
>=8.2
- Laravel
^11.0 || ^12.0
π Installation
βοΈ Configuration & Migration
Publish the configuration and migration with:
This will publish:
config/activity-log.php
database/migrations/xxxx_xx_xx_xxxxxx_create_activity_logs_table.php
Then run the migration:
π§βπ» Usage
Logging a manual activity
π§± Table Structure: activity_logs
Column | Type | Description |
---|---|---|
id |
UUID | Primary key |
parent_id |
UUID | Link to parent log (optional) |
log_type |
String | Type of action (e.g. create) |
user_id |
String | Authenticated user ID |
module |
String | App module or context |
route |
String | Route name |
url |
String | Full URL accessed |
model_id |
String | Related model ID (optional) |
model_type |
String | Related model class (optional) |
user_agent |
Text | Browser/user-agent string |
created_at |
DateTime | When the log was created |
π§Ή Uninstall (Clean Up)
Run this command before removing the package:
It will:
- Roll back the migration (calls
down()
) - Delete related migration files
- Remove the config file
Then remove the package:
π€ Contributing
Pull requests are welcome! For major changes, please open an issue first.
πͺͺ License
MIT License Β© Shukhratjon Yuldashev
π‘ Automatic Logging for All Requests
To log every request made to your Laravel application, you can use the provided middleware and HTTP macro.
β 1. Register the Middleware
In your app/Http/Kernel.php
, register the middleware globally or per group:
This will automatically log incoming HTTP requests, including route, URL, method, and user info.
β 2. Log Outgoing HTTP Requests
The package extends Laravelβs Http
client with a loggable()
macro.
Example usage:
This logs outgoing HTTP calls made by your application.
π§© Customization
You can customize what gets logged, ignored routes/methods, and the database connection via:
π« Support
If you need help, feel free to contact Shukhratjon Yuldashev on Telegram.