Apiable::modelResourceMap() for every model, matching single-resource behavior—improving parity across response shapes.AllowedFilter::notEqual() / notLike() negated filters add server-driven filtering expressiveness, reducing the need for bespoke endpoints or GraphQL-like workarounds for exclusion queries. Comma-separated negated values combine with AND, a contract detail clients must understand.Apiable::resource().links, meta, included relationships).modelResourceMap() where mixed-model collections exist.modelResourceMap(), preserving override paths for edge cases.| Risk Area | Mitigation Strategy |
|---|---|
| Schema Drift | Use apiable:validate Artisan command to catch compliance issues early. |
| Performance Overhead | Benchmark relationship loading (eager loading vs. Apiable::with()). |
| Custom Logic Conflicts | Extend via ApiableServiceProvider or override default behaviors. |
| Deprecation Risk | Monitor Laravel version support; fork if needed (MIT license allows modification). |
| Testing Complexity | Use PestPHP or PHPUnit to test JSON:API responses with ApiableTestCase. |
| Sparse Fieldset Regression | Add explicit tests asserting internal hydration keys never leak into attributes while requested appends remain visible. |
| Filter Semantics Drift | Document that comma-separated negated values combine with AND; add contract tests for notEqual/notLike. |
| Collection Resource Mapping | Verify modelResourceMap() coverage for every model in mixed collections; confirm explicit resource precedence. |
| Duplicate Filter Config | Benefit from 4.5.0 idempotency; remove now-unnecessary defensive workarounds. |
id fields, singular resource names)?AND-combined comma-separated negation the expected client contract?modelResourceMap() registration and sparse-fieldset regression tests?| Component | Compatibility |
|---|---|
| Laravel Core | 9.x/10.x (PHP 8.1+). |
| Eloquent Models | Full support (uses Apiable trait). |
| API Resources | Replaces or extends JsonResource. |
| Lumen | Partial support (check for missing Laravel-specific features). |
| Testing | Works with Laravel testing helpers (assertJsonApiFragment). |
| Caching | Supports Apiable::cache() for serialized responses. |
| Validation | Integrates with Laravel’s Form Requests for input validation. |
| Filtering (4.5.0) | AllowedFilter::notEqual() / notLike(); comma-separated negated values combine with AND. |
| Mixed-Model Collections (4.5.0) | Per-model resolution via modelResourceMap(); explicit resource class wins. |
links).use Apiable; to Eloquent models and replace JsonResource with ApiableResource.Apiable::resource() instead of raw JSON.Apiable::with('posts')).modelResourceMap() where collections span multiple models.php artisan apiable:validate to catch issues.type fields).notEqual/notLike filters; add indexes where selective.| Priority | Task | Dependencies |
|---|---|---|
| 1 | Upgrade to 4.5.0; run full API contract regression suite. | None |
| 2 | Replace JsonResource with ApiableResource in core models. |
Existing API resources. |
| 3 | Update controllers to use Apiable::resource(). |
Step 2. |
| 4 | Enable relationships and pagination. | Step 3. |
| 5 | Register modelResourceMap() for mixed-model collections. |
Step 3. |
| 6 | Validate compliance with apiable:validate. |
Steps 1–5. |
| 7 | Adopt notEqual/notLike filters with contract and performance tests. |
Step 6. |
| 8 | Customize serializers/transformers for edge cases. | Step 6. |
| 9 | Implement caching and performance tuning. | Step 8. |
apiable:validate, apiable:publish (config overrides).assertJsonApiFragment; add targeted tests for 4.5.0 behaviors (sparse-fieldset key retention, mixed-model collection mapping, idempotent default filters).AND semantics of negated comma-separated filters may lag the release.modelResourceMap() registration when collection items serialize with unexpected types.dd(Apiable::toArray($resource)) to inspect serialization.Apiable::with() judiciously to avoid N+1 queries.Apiable::cache() for static or rarely changing data.!= and NOT LIKE can bypass indexes and force scans; gate exposure to high-cardinality endpoints and benchmark before broad rollout.throttle middleware for APIable endpoints.fields() to reduce payload size; 4.5.0 ensures hydration keys don’t inflate the response.Apiable::load('*'); specify only needed relationships.modelResourceMap() lookups are per-model; verify no material overhead in large mixed collections.| Scenario | Impact | Mitigation |
|---|---|---|
| Schema Violation | API clients reject malformed responses. | Use apiable:validate in CI/CD. |
| Circular References | Infinite loops in serialization. | Configure Apiable::ignore() or use Apiable::maxDepth(). |
| Relationship Overfetching | High DB load. | Use Apiable::with() selectively. |
| Cache Stale Data | Inconsistent responses. | Set short TTLs or use cache tags. |
| Laravel Upgrade Issues | Package compatibility breaks. | Test on staging; fork if needed. |
| Negated Filter Cost | Slow queries / full scans from != / NOT LIKE. |
Restrict operators by endpoint; index review; benchmark. |
| Missing Collection Mapping | Mixed-model collections serialize with wrong type. |
Register every model in modelResourceMap(); add contract tests. |
| Sparse Fieldset Leakage | Internal keys exposed or relationships fail to hydrate. | Regression tests post-4.5.0; assert attributes and included relationships. |
| Duplicate Filter Config | Empty queries from duplicated scalar filters (pre-4.5.0). | Upgrade to 4.5.0; remove workarounds; add config tests. |
modelResourceMap() entries, and add filter/sparse-fieldset regression tests. Negated filter adoption can be phased per endpoint with minimal client coordination.How can I help you explore Laravel packages today?