Download the PHP package deifhelt/laravel-activity-presenter without Composer
On this page you can find all versions of the php package deifhelt/laravel-activity-presenter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download deifhelt/laravel-activity-presenter
More information about deifhelt/laravel-activity-presenter
Files in deifhelt/laravel-activity-presenter
Package laravel-activity-presenter
Short Description Activity presenter for Laravel.
License MIT
Informations about the package laravel-activity-presenter
Laravel Activity Presenter
Laravel Activity Presenter is a powerful presentation layer for spatie/laravel-activitylog. It solves the common challenges of displaying activity logs in your application: resolving relationships efficiently, formatting data consistently, and handling translations.
Why use this?
When displaying activity logs, you often face these issues:
- N+1 Queries: Showing "User X updated Project Y" requires loading the User and Project models for every log entry.
- Missing Context: If "Project Y" is deleted, you still want to show its name in the log history, but the relationship is null.
- Unformatted Data: You have
user_id: 5in the log properties, but you want to display "John Doe". - Inconsistent Presentation: You find yourself repeating
trans('...')...logic in every Blade view.
This package solves all of them.
Key Features
- Smart Resolution: Automatically resolves related models (User, Subject) in a single optimized query to prevent N+1 issues.
- Object-Oriented: Provides rich objects (
LogEntry,AttributeChange) instead of flat strings, giving you full control in your View. - Config-Driven: Define how specific attributes (like
category_id) map to models in a simple config file. - Auto-Localization: Built-in support for translating events (
created->Creado), model names (User->Usuario), and attributes. - Agnostic & Flexible: Does not force date formats or string styles. You get the raw
Carbonobjects and Models to format however you like.
Installation
Install via Composer (Spatie Activitylog is included automatically):
Publish the configuration:
Quick Usage
1. In your Controller
2. In your Blade View
Documentation
- Installation & Configuration - Deep dive into setup and config options.
- Logging Guide - Best practices for logging model events.
- Usage Patterns - Advanced usage in Controllers, Views, and APIs.
- Localization - How to translate every aspect of your logs.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-activity-presenter with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0||^13.0
spatie/laravel-activitylog Version ^4.10