Suman Shrestha

Snippets | Suman Shrestha

Code Snippets & Insights

3 articles

Native Eager Load Limit

Laravel 11 brings native support for limiting eager loaded relationships, fixing a long-standing "n+1 with limit" issue.

Method-Based Model Casts

Laravel 11 introduces a static casts() method for defining eloquent attribute casting, offering more power than the property array.

Eager Loading Only Required Attributes in Laravel Relationships

Learn how to optimize eager loading in Laravel relationships by loading only the required attributes.

-

Need one on one help with Laravel and its ecosystem?

Talk to me now if you need my help. Click here