The New Way to Define Eloquent Accessors and Mutators

The creator of Laravel, Taylor Otwell, recently introduced a new, improved way to declare accessors and mutators on your Eloquent models. While the traditional getNameAttribute and setNameAttribute syntax won’t go away, I think you’ll appreciate this new single-method approach for being a bit more in the Laravel spirit. Let’s take a look. Watch thousands of videos, track your progress, and participate in a massive Laravel community at . Laracasts: Laracasts Twitter: Jeffrey Way Twitter:
Back to Top