1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/content/tips/use-appends-to-include-properties-in-the-array-representation-of-your-model.md
2021-11-19 16:10:01 +01:00

567 B

title tweet_id thread_slug author_username images created_at slug
Use $appends to include properties in the array representation of your model 1461703842026770438 weekly-thread-2021-46 xiCO2k
https://pbs.twimg.com/media/FEO04rDXsAAQx6i.jpg
2021-11-19T14:32:07+00:00 use-appends-to-include-properties-in-the-array-representation-of-your-model

Had to revisit a #Laravel project from 3 years ago, and found out I did append a mutator in the toArray method 😂, there is no need for that, we can use the "$appends" and it does the same job