Laravel 13 Native Attributes: Slimmer Models and a Cleaner Codebase

php dev.to

Open the biggest model in your app right now. Ours was Server.php, and before we refactored it this spring, the first 60 lines were pure configuration: a $table override from an old naming decision, a 14-entry $fillable array, $hidden for two token columns, a casts() method with nine entries, and a $touches array nobody had questioned since 2024. Sixty lines before the first line of actual behavior. Every Laravel developer has a model like this, and most of us stopped seeing the clutter years ag

Read Full Tutorial open_in_new
arrow_back Back to Tutorials