Download the PHP package maksudur-dev/laravel-logpilot without Composer
On this page you can find all versions of the php package maksudur-dev/laravel-logpilot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maksudur-dev/laravel-logpilot
More information about maksudur-dev/laravel-logpilot
Files in maksudur-dev/laravel-logpilot
Package laravel-logpilot
Short Description A lightweight activity logging package for Laravel with request tracing.
License MIT
Homepage https://github.com/maksudur-dev/laravel-logpilot
Informations about the package laravel-logpilot
Laravel LogPilot
A lightweight Laravel activity logging package that improves debugging, tracing, and business-event visibility while using Laravel's EXISTING logging system or a database.
Key Features
- Request Tracing: Group multiple logs under a single
log_idautomatically. - Dual Drivers: Support for Laravel Logs, Database, or both.
- Auto-Context: Automatically captures User ID, IP, URL, and Method.
- Model Support: Easily associate activities with Eloquent models.
- API Support: Optional API endpoints to view activity logs.
- Artisan Commands: Install, prune, and test your setup easily.
- Lightweight: Zero-config by default, minimal overhead.
Installation
You can install the package via composer:
Run the installation command:
If you are using the database driver, run the migrations:
Configuration
The configuration file is located at config/logpilot.php.
Usage
1. Global Helper (Quickest)
2. Eloquent Trait (Recommended for Models)
Add the LogsActivity trait to your models:
3. Service Usage
Inject the ActivityLogger service into your classes:
4. Grouping Related Logs (Tracing)
Perfect for complex flows like checkouts or background jobs:
Frontend Integration (Vue/React Example)
Since LogPilot provides an API, you can easily build a "Recent Activity" component.
Example Vue Component
Example React Component
Example Blade Component
If you prefer server-side rendering, you can pass logs to a Blade component:
API Support
LogPilot exposes clean, JSON-ready endpoints:
GET /api/activity-logs: All logs.GET /api/activity-logs/trace/{log_id}: Trace a full request lifecycle.GET /api/activity-logs/model/{type}/{id}: Activity for a specific resource.
Artisan Commands
php artisan activity:install: Setup everything.php artisan activity:prune: Cleanup old logs.php artisan activity:test: Verify installation.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-logpilot with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/log Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^8.0|^9.0|^10.0|^11.0|^12.0