Loading video...

Video Failed to Load

Go Home

Property hooks, one of the new features in PHP 8.4, can remove the need for traditional getter and setter methods entirely. Got 5 minutes for me to show you the essentials?

36,044 views • 1 year ago •via X (Twitter)

5 Comments

Laracasts's profile picture
Laracasts1 year ago

And if you'd like to review this in greater detail, we cover it on Laracasts today.

Tony Lea's profile picture
Tony Lea1 year ago

Love this format. You should do Laracasts on TikTok 🤙

Stephan Robert's profile picture
Stephan Robert1 year ago

I think i'll keep the "old" way of doing things. I think that properties initialisation place should be as clean as possible ( and explicit ). For a simple setter, sure, it looks fine, but when you have something like your example, it just hit you in the face. Don't throw rocks.

iSajadUlMulk's profile picture
iSajadUlMulk1 year ago

@jwmcpeak That's amazing, I already have used them in C# quite alot, somehow it seems like this idea being borrowed from there .. 😂😂😂 no offense

Punjabi Lad's profile picture
Punjabi Lad1 year ago

we can officially say goodbye to boilerplate getter & setter methods!

Related Videos