joelbutcher/laravel-archivable
Add archiving to Laravel Eloquent models like SoftDeletes. Includes migration macros for archived_at, model trait, and query builder scopes/macros to archive/unarchive records and filter archived vs active results in fluent chains.
Architecture fit: Excellent alignment with Laravel's Eloquent pattern. Uses trait-based approach consistent with core features like SoftDeletes, requiring no architectural changes. Migration macro integrates cleanly with Laravel's schema builder.
Integration feasibility: High. Composer-based installation with minimal setup (add trait, update migration). Documentation provides clear examples for common use cases. No complex configuration needed for standard implementations.
Technical risk: Low. Actively maintained (Laravel 12.x support in v1.12.0), includes test coverage, and follows Laravel conventions. However, 0 dependents on Packagist suggests limited real-world validation at scale. Potential conflict if used alongside SoftDeletes on same model.
Key questions: How does it handle relationship archiving (e.g., cascading)? What indexing strategy is recommended for archived_at in high-volume tables? Does it support custom archive reasons/metadata beyond timestamp? How does it interact with third-party query builders like Laravel Scout?
Stack fit: Ideal for Laravel 7+ applications. Fully compatible with standard Laravel Eloquent stack components. Works with Livewire, Nova, and most ORM-adjacent packages. No dependency conflicts detected in recent releases.
Migration path: Additive implementation: 1) Run migration with archivedAt() macro 2) Add trait to target models 3) Update queries where needed (e.g., withArchived() for admin views). Safe for incremental rollout without breaking existing functionality.
Compatibility: Works with Laravel 12.x (current version). Conflicts possible if using SoftDeletes on same model (both modify global scopes). Not compatible with non-Eloquent data sources (e.g., raw DB queries without scope awareness).
Sequencing: 1) Add migration column to all target tables 2) Add trait to models 3) Implement archiving flows in UI/services 4) Update query logic for admin/audit views 5) Test route model binding with ->withArchived() where needed. Avoid simultaneous SoftDeletes usage.
Maintenance: Minimal. Single-trait solution with stable API. No recurring configuration or background jobs. Updates require composer upgrades only. Documentation is comprehensive for current use cases.
Support: Community-driven with active GitHub contributions (recent PRs merged). No commercial support option. Limited team size (single primary maintainer) may impact response time for complex issues.
Scaling: Indexed archived_at column recommended for large datasets. Query performance depends on proper indexing strategy (no built-in partitioning). No inherent scaling limitations for standard workloads.
Failure modes: Accidental data archive via missing unArchive() in UI flows. Performance degradation if archived_at is unindexed in high-traffic tables. Potential scope conflicts if SoftDeletes and Archivable used together.
Ramp-up: Very low. Laravel developers familiar with SoftDeletes will understand immediately. Clear examples in docs reduce onboarding time. Typical implementation requires <1 hour per model.
How can I help you explore Laravel packages today?