h-farm/laravel-excludable
Laravel Excludable adds a lightweight trait to Eloquent models so specific records can be excluded from queries by default and included only when needed. Ideal for hiding archived or inactive rows without soft deletes or custom scopes, keeping filtered results clean and relationships predictable.
Consider it when:
where clauses scattered across the codebase.^4.1 and re-run your test suite after upgrading.where leaks hidden records.Look elsewhere when:
SoftDeletes already gives restore, force-delete, and with-trashed behavior) — running both abstractions risks confusing, overlapping visibility rules.Adoption checklist: verify L11 constraint in composer.json, confirm migration/state-column strategy, add a regression test asserting default queries exclude rows and explicit include paths return them, and document the behavior for analytics/reporting owners.
For executives: This is a small, focused Laravel add-on that implements a common product behavior — hiding records from normal views while keeping the data intact — as a reusable pattern instead of custom code. The new 4.1.0 release is primarily a Laravel 11 compatibility update, which removes a blocker on our framework upgrade path and signals the package is maintained. Cost/benefit: low integration effort, reduced custom code and bug surface for "hide/restore" features, with the main residual risk being reliance on a small third-party maintainer — mitigated by keeping usage behind a thin internal abstraction so it can be swapped or replicated internally if maintenance lapses.
For engineering: v4.1.0 adds Laravel 11.x support (PR #30). It's a non-breaking, compatibility-only change — no migration or API changes implied for existing users. Recommended actions: bump to ^4.1, confirm the L11 constraint resolves in your lockfile, re-run the suite, and add explicit tests covering default-excluded and explicitly-included query paths. Because exclusion is enforced via global scopes, be deliberate about reporting/analytics queries and admin tooling that must see excluded rows, and avoid overlapping it with SoftDeletes on the same model.
How can I help you explore Laravel packages today?