splash/scopes package appears to provide query-scoping capabilities (e.g., filtering, access control, or domain-specific query constraints) via a Laravel/Eloquent-compatible API. This aligns well with:
Model::scope1()->scope2()) or combined dynamically?globalScopes for tenant/soft-deletes? Overlap or conflict risk?| Risk Area | Severity | Mitigation |
|---|---|---|
| Query Plan Bloat | Medium | Profile with DB::enableQueryLog(); avoid over-nesting scopes. |
| Scope Leakage | High | Ensure scopes don’t accidentally filter unintended queries (e.g., eager loads). |
| Laravel Version Lock | Low | Pin package version; test against Laravel’s LTS branches. |
| Custom Logic Injection | Medium | Validate scope definitions for SQL injection (if dynamic). |
| Testing Coverage | High | Write integration tests for scope interactions (e.g., scopeA()->scopeB()). |
Scope::whereFn(fn($query) => ...))?orWhere, subqueries)?spatie/laravel-query-builder, stancl/tenancy) with broader adoption?where clauses in repositories./api/users returns only user’s team members).where('tenant_id', auth()->tenant()->id)).UserScope, OrderScope).User or Order).scopeA()->scopeB()).with(), has()).remember() or cache().retrieved).splash/scopes and stancl/tenancy define global scopes.laravel/api-resources for filtered responses.spatie/laravel-searchable or Algolia.TenantScope, RoleScope).@scope Tenant isolation).DB::enableQueryLog() to inspect scoped queries.Model::with('scopedRelation')).orWhere or subqueries.How can I help you explore Laravel packages today?