Download the PHP package monty7352/quick-activity-log without Composer
On this page you can find all versions of the php package monty7352/quick-activity-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download monty7352/quick-activity-log
More information about monty7352/quick-activity-log
Files in monty7352/quick-activity-log
Download monty7352/quick-activity-log
More information about monty7352/quick-activity-log
Files in monty7352/quick-activity-log
Vendor monty7352
Package quick-activity-log
Short Description A lightweight activity logger for Laravel Eloquent models.
License MIT
Package quick-activity-log
Short Description A lightweight activity logger for Laravel Eloquent models.
License MIT
Please rate this library. Is it a good library?
Informations about the package quick-activity-log
Quick Activity Log for Laravel
A lightweight and easy-to-use activity and audit logging package for Eloquent models in Laravel. Automatically tracks model creation, updates, and deletions without complex setup.
Features
- 🚀 Zero configuration needed to get started.
- 📦 Automatically tracks
created,updated, anddeletedevents on Eloquent models. - 💾 Stores attributes/changes as JSON in database.
- ⚡ Lightweight and fast execution.
Installation
You can install the package via Composer:
composer require your-github-username/quick-activity-log
## Usage
Add the `LogsActivity` trait to any Eloquent model you want to track:
### Fetching Logs
You can fetch logs using the `ActivityLog` model:
Run the migrations to create the activity_logs table:
Bash
php artisan migrate
Usage
Add the LogsActivity trait to any Eloquent model you want to track:
PHP
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use YourGithubUsername\QuickActivityLog\Traits\LogsActivity;
class User extends Model
{
use LogsActivity;
protected $fillable = ['name', 'email', 'password'];
}
Fetching Logs
You can fetch logs using the ActivityLog model:
PHP
use YourGithubUsername\QuickActivityLog\Models\ActivityLog;
// Retrieve all activity logs ordered by newest first
$logs = ActivityLog::latest()->get();
foreach ($logs as$log) {
echo "Model: " . $log->subject_type . "\n"; // e.g., App\Models\User
echo "Model ID: " . $log->subject_id . "\n"; // e.g., 1
echo "Action: " . $log->action . "\n"; // created, updated, or deleted
// Output changed data array
print_r($log->changes);
}All versions of quick-activity-log with dependencies
PHP Build Version
Package Version
The package monty7352/quick-activity-log contains the following files
Loading the files please wait ...