Spatie packages: which are actually essential in 2024
Spatie puts out a lot of packages. After years of using them, here are my opinions on which are genuinely essential vs nice-to-have vs not worth the dependency.
spatie/laravel-permission: essential for any app with roles. The polymorphic design handles complex permission schemes well. The caching integration means no extra queries per request. Use it.
spatie/laravel-medialibrary: best media management package in the ecosystem. Conversions, responsive images, S3 support. Worth it for any app handling user uploads.
spatie/laravel-query-builder: useful if you need filterable, sortable, paginated APIs without writing the same query builder boilerplate 20 times. The include/filter/sort system is clean.
spatie/laravel-activitylog: good in theory but generates a lot of DB writes. Be selective about what you log. We disabled it on models that change frequently and use it only for security-relevant actions.
spatie/laravel-backup: one of the few packages where alternatives are weak. Automated DB + file backups with S3 or FTP destination, notifications on failure. Install it on every production app.
spatie/data-transfer-object (now spatie/laravel-data): divisive. Some teams love typed DTOs for request/response objects. Others find it over-engineered for simple CRUD. Useful when you need complex data transformations.
```php blocks are runnable.