mpyw/compoships-eager-limit
Compoships) while preserving eager-loading limits (via eloquent-eager-limit).Post::morphToMany([User::class, Comment::class])).eloquent-eager-limit is deprecated in Laravel 11+).belongsToMany, morphToMany).eloquent-eager-limit is core). Migration to native withLimit() would be required.Compoships is actively maintained, but eloquent-eager-limit is deprecated in Laravel 11+. Risk of future breakage if Compoships drops support.withLimit()?Compoships? If not, simpler packages like eloquent-eager-limit alone may suffice.tntsearch/laravel-scout-tnt or similar tools.withLimit().morphToMany, belongsToMany).withLimit()) on the Eloquent query builder.composer require topclaudy/compoships:^2.0.4 mpyw/compoships-eager-limit
Model::with('polymorphicRelation')->get();
With:
Model::withLimit('polymorphicRelation', 5)->get();
Post morphing to User/Comment).withLimit()).Compoships.Compoships).withLimit() logic (test thoroughly)./api/posts).Compoships → eloquent-eager-limit (deprecated in Laravel 11+).withLimit(1000)).| Failure Scenario | Impact | Mitigation |
|---|---|---|
Misconfigured withLimit() |
Memory exhaustion (loading too many records) | Set default limits in a base model. |
| Database connection issues | Timeouts or partial eager-loads | Implement retry logic for queries. |
| Laravel 11+ upgrade | Package becomes obsolete | Plan migration to native withLimit(). |
Compoships breaking change |
Polymorphic queries fail | Pin to a specific Compoships version. |
| Nested eager-loading conflicts | Infinite loops or stack overflows | Avoid nested withLimit() calls. |
Compoships and eloquent-eager-limit basics.How can I help you explore Laravel packages today?