- Does this package work with Laravel 11 or older versions?
- No, this package requires Laravel 12 or 13 due to its dependency on Spatie’s Activity Log v5 and PHP 8.4+. If you’re on an older stack, you’ll need to upgrade or use an alternative like the original Spatie UI or a custom solution.
- What happens if I don’t have Spatie’s Activity Log installed?
- This package **only provides a UI layer** and assumes Spatie’s Activity Log is already configured. You’ll need to install `spatie/laravel-activitylog` (≥v5.0) first, migrate your database schema, and ensure your models are logging activities before using this UI.
- Can I customize the UI without knowing Tailwind or Alpine.js?
- Yes, but with limitations. The package publishes Blade views and CSS/JS assets, so you can override them via `resources/views/vendor/activitylog-ui`. For deep customization (e.g., replacing Alpine.js logic), frontend knowledge is helpful, but basic tweaks like colors or layouts are manageable via Tailwind classes.
- How does performance scale with millions of activity log entries?
- The package uses Laravel’s cache for pagination and real-time counts, which helps, but large datasets (>1M entries) may still strain queries. Optimize by enabling `exports.queue.enabled` for background exports, using PostgreSQL (better for complex queries), and adjusting `analytics.cache_duration` to reduce live query loads.
- Are there alternatives if I don’t want to use Alpine.js or Tailwind?
- Yes, you could build a custom UI using Laravel Blade, Inertia.js (React/Vue), or even a separate frontend framework. Alternatives like `spatie/laravel-activitylog`’s basic UI or packages like `orchid/software` (which includes activity log features) might fit better if you need more frontend flexibility.
- How do I restrict access to the activity log UI for specific roles?
- Use Laravel’s built-in gates or middleware. Configure `authorization.enabled=true` in the config, then define allowed users/roles via `access.allowed_users` or `access.allowed_roles`. For advanced RBAC, integrate with packages like `spatie/laravel-permission` and extend the middleware logic.
- What’s the best way to handle exports for large datasets?
- Enable queued exports by setting `exports.queue.enabled=true` in the config. This offloads heavy CSV/Excel/PDF generation to Laravel queues. For immediate exports, ensure your server has enough memory, but test with sample data first to avoid timeouts.
- Can I use this package in a Laravel microservice architecture?
- Yes, but ensure Spatie’s Activity Log is properly configured across services sharing the same database. The UI will work as long as the `activity_log` table is accessible. For distributed setups, consider caching or read replicas to handle query loads from the UI.
- Does the timeline view support custom event formatting?
- The timeline view uses Spatie’s default event formatting, but you can customize it by overriding the Blade view (`resources/views/vendor/activitylog-ui/timeline.blade.php`). Modify the `{{ $log->description }}` or `{{ $log->properties }}` sections to display data differently, or extend the `ActivitylogUiServiceProvider` to add custom logic.
- How do I upgrade from v1.x to v2.0 without breaking my app?
- Follow the [UPGRADING.md guide](https://github.com/MuhammadSadeeq/laravel-activitylog-ui/blob/main/UPGRADING.md) carefully. Key steps include updating Spatie’s Activity Log to v5, migrating your database schema (if needed), and adjusting any customizations for breaking changes in v2.0’s config or views. Test thoroughly in staging first.