Multiplexable) and service providers for minimal intrusion into existing codebases. Existing models can opt-in without refactoring.make:multiplex) to scaffold versioned metadata tables, easing adoption.model_multiplexes) per model, increasing DB complexity. Risk of orphaned records if not managed (e.g., soft-deletes, cascading).VALID FROM/TO).User, Product).user_multiplexes table).composer require kolossal-io/laravel-multiplex
php artisan make:multiplex User --name=profile --attributes=title,location
LogEntry).// Example: Access latest version
public function getLatestProfileAttribute() {
return $this->multiplex('profile')->latest()->first();
}
Cache::remember for performance-critical paths./users/{id}?with_versions=true).scopeWithVersionBetween).php artisan migrate --pretend to validate.Multiplex::debug() to inspect versioned records.$user->multiplex('profile')->get();
(model_id, versioned_at) composite index.model_id if scaling vertically isn’t enough.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Migration Failure | Broken versioned tables | Test migrations in staging; use rollback. |
| Orphaned Versions | Inconsistent data | Add deleted_at to versioned tables. |
| Query Timeouts | Slow API responses | Add indexes; paginate results. |
| Concurrency Issues | Lost updates | Implement retries or DB locks. |
| Storage Bloat | High DB costs | Set retention policies; archive old data. |
| Package Abandonment | No future updates | Fork the package if critical. |
WHERE versioned_at BETWEEN clauses.Product but not User").How can I help you explore Laravel packages today?