Video wird geladen...
Video konnte nicht geladen werden
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 Aufrufe • vor 1 Jahr •via X (Twitter)
5 Kommentare

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

Tony Leavor 1 Jahr
Love this format. You should do Laracasts on TikTok 🤙

Stephan Robertvor 1 Jahr
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.

iSajadUlMulkvor 1 Jahr
@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 Ladvor 1 Jahr
we can officially say goodbye to boilerplate getter & setter methods!

