⚠️ This post links to an external website. ⚠️
New Laravel 13 went all-in on PHP attributes. Properties like
$fillable,$guarded, and$hiddenthat you've been defining on models for years can now be declared as class-level attributes:#[Fillable],#[Guarded], and#[Hidden]. The same applies to job configuration, console command signatures, middleware, and more.In this article, I'll walk you through every PHP attribute available in Laravel 13 — both the new ones and those that existed before — with practical code examples for each.
Important notice: those attributes are optional, and you may use the old syntax in all those cases. The attributes are NOT breaking changes, just the new alternatives.
continue reading onlaraveldaily.com
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.