Laravel/PHP devs: Are you embracing Property Promotion for cleaner constructors, or sticking with the traditional approach? 🤔

Share your thoughts! 👇

26

Even from final readonly classes in PHP… 🔐

You can still hack your way into private properties using Closure::call() 🛠️

A clever trick for testing, debugging, or exploring value objects. 🧪
image

1

22

AWS has hundreds of services. In the time I typed this, they probably added two more. I don't know half of them, but here's one I stumbled across that solved a real problem with RDS backups.

masteringlaravel.io/daily/2025-06-24-how-to-retain-backups-longer-than-35-days-in-aws-rds

26


image

Solving N+1 Queries in Laravel with `chaperone()`

`chaperone()` method in Eloquent relationships especially helpful on inverse or "child-to-parent" relations to automatically hydrate the parent onto each child, eliminating the dreaded N+1 query pattern

This ensures that when we eager load comments, each Comment instance gets its parent Post assigned without extra queries

Why It Matters
Without `chaperone()`, even with eager loading, looping through children and accessing `$comment->post` triggers individual queries for each relationship the classic N+1 pitfall. `chaperone()` bundles the parent relation on the child records in one go, boosting performance and scalability

27