Download the PHP package djl997/filament-model-activity-page without Composer
On this page you can find all versions of the php package djl997/filament-model-activity-page. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download djl997/filament-model-activity-page
More information about djl997/filament-model-activity-page
Files in djl997/filament-model-activity-page
Package filament-model-activity-page
Short Description A reusable Filament v5 page that renders a chat-style activity feed for any Eloquent model with a polymorphic activities relation
License MIT
Informations about the package filament-model-activity-page
filament-model-activity-page
A reusable Filament v5 page that renders a chat-style activity feed for any Eloquent model with a polymorphic activities relation.
Requirements
- PHP 8.2+
- Laravel 12+
- Filament 5+
Installation
1. Publish and run the migration
2. Add the trait to your model
3. Create a Filament page
4. Register the page in your resource
5. Add the package views to your Filament theme
In resources/css/filament/app/theme.css:
Then rebuild: npm run build
Override points
| Method | Default | Purpose |
|---|---|---|
getEagerLoadRelations() |
['activities.user'] |
Add extra eager-load chains |
getChatMessages() |
loads activities on record |
Override to aggregate from related models |
getChildActivities() |
[] |
Merge activities from child/related models into the feed |
isPrivilegedUser() |
false |
Bypasses rate limiting |
canSendInternalMessages() |
false |
Shows the internal checkbox on the compose form |
afterClientMessage(array $data) |
no-op | Send notifications after a client posts |
resolveActivityIcon(array $activity) |
null |
Return a Heroicon name to show an icon on any activity |
Aggregating child model activities
Override getChildActivities() to pull activities from related (child) models into the same feed. Each entry must have an activities key (an iterable of Activity models) and a context key (a label shown on each message to indicate its origin).
The context label is rendered as a small faded tag next to the message text, so readers can tell which child record the activity belongs to. Activities on the page's own record show no context label.
Adding icons to activities
Override resolveActivityIcon() in your page class to return a Heroicon name for a given activity. The $activity array contains all formatted fields including level, is_internal, message, etc.
Icons are rendered on info-bar (Event) activities only. Chat bubbles do not show icons.
Configuration
Publish the config to swap in your own Activity model or customise internal message visibility:
Panel plugin registration (optional)
If you want to register the plugin explicitly with a Filament panel:
All versions of filament-model-activity-page with dependencies
filament/filament Version ^5.0
laravel/framework Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.15.0