Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Softdeletes Laravel Package

dcat/laravel-softdeletes

dcat/laravel-softdeletes adds enhanced soft delete support to Laravel Eloquent models. Cascade deletes and restores across related records, keep data consistent, and avoid unique constraint conflicts from trashed rows, all through simple traits with minimal configuration.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: Good fit only for Laravel/Eloquent applications that need to preserve native-style soft deletes while freeing primary tables from deleted_at-driven unique-index compromises. The separate archive-table pattern can reduce main-table bloat and index pressure on high-churn tables with natural or composite unique keys. It is a weaker fit for models with complex relation graphs, heavy restore workflows, raw SQL access, or strict referential-integrity requirements, because deleted rows move outside the original table.

Integration feasibility: Feasible as a targeted package, not as a broad platform default. It requires replacing Laravel’s SoftDeletes trait on selected models, creating archive tables/migrations, validating query behavior, and backfilling existing soft-deleted rows. Integration is straightforward for standard Eloquent CRUD but needs explicit testing for withTrashed, onlyTrashed, restore, force delete, model events, cascades, bulk operations, and relation queries.

Technical risk: Maturity is the primary risk. The package has 36 stars, zero dependents, a last release of 2021-01-18, and likely a single-maintainer upstream. Laravel/PHP compatibility with current versions is unproven without a spike. Behavioral differences from native soft deletes can create data-loss or restore-conflict risks, especially if archive insertion and original-row deletion are not atomic. Raw SQL, database constraints, and third-party packages will not automatically understand the archive table.

Key questions: Which Laravel, PHP, and database versions are supported? Does it preserve Eloquent events, observers, global scopes, and relation behavior? How are restore conflicts handled when a unique key has been reused? Are deletes and archive writes transactional? Does it support composite unique indexes, bulk deletes, cascades, and force deletes? What is the archive-table naming/config model? Can existing soft-deleted data be backfilled safely? Is the package forkable and testable enough for internal ownership?

Integration Approach

Stack fit: Suitable for a Laravel monolith or service where soft-deleted records are accessed through Eloquent and where unique-index pressure is a measured problem. Less suitable where deleted records must remain in the same relational graph, where DB-level foreign keys reference soft-deleted rows, or where reporting relies on direct table access.

Migration path: Start with a compatibility spike and one low-risk internal model. Inventory all models using SoftDeletes, classify by relation complexity and restore frequency, create archive-table schemas, backfill existing deleted rows, switch the trait on the pilot model, and compare native versus package behavior in staging. Expand only after restore, unique-key reuse, and rollback are proven.

Compatibility: Pin the dependency and test against the application’s actual Laravel/PHP/database matrix. If current Laravel or PHP versions are unsupported, budget for a fork or internal patch before adoption. Avoid adopting across many models until the package’s scope and transaction behavior are verified in code.

Sequencing: 1) inventory soft-delete usage and unique-index pain; 2) run compatibility/behavior spike; 3) design archive tables and backfill; 4) pilot one model with observability; 5) validate restore/force-delete/bulk/relation flows; 6) roll out model by model; 7) retain a fallback path to native soft deletes or a forked implementation.

Operational Impact

Maintenance: Expect internal ownership. Upstream activity is stale, dependents are zero, and community support is minimal. The team should be prepared to fork, patch, and maintain compatibility with future Laravel/PHP releases. MIT licensing makes a fork legally straightforward.

Support: No vendor support and a small user base means debugging falls to the adopting team. Require code review of trait behavior, automated tests around delete/restore, and documentation of archive-table conventions. Treat it as an internal utility with an owner, not a fire-and-forget Composer dependency.

Scaling: The pattern can improve main-table performance by removing deleted-row index bloat, but archive tables still grow and need indexes, retention policies, and possibly partitioning. Deletes become multi-step writes, increasing transaction and I/O cost. Trashed-record queries may become more complex and less index-efficient than native soft deletes.

Failure modes: Partial delete failures can leave orphaned original or archive rows. Restore can fail when a unique key has been reused. Bulk deletes, raw SQL, cascades, and queued jobs may bypass expected behavior. Relation queries may miss archived rows. Model events and observers may not match native semantics. Monitoring should cover archive-write failures, restore conflicts, archive-table growth, and divergence between original and archive records.

Ramp-up: Moderate. Developers must understand the replacement trait, archive schema, transaction boundaries, and restore/unique-key semantics. Provide a short internal guide, test fixtures, and runbooks before broad rollout. Prefer a pilot-first adoption with explicit rollback criteria rather than a platform-wide migration.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core