1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/create-traits-for-relationships-you-commonly-use-in-your-models-to-make-your-codebase-cleaner-simpler-and-more-consistent.md
2021-10-29 20:50:56 +02:00

640 B
Raw Blame History

title tweet_id thread_slug author_username images created_at slug
Create traits for relationships you commonly use in your models to make your codebase cleaner, simpler, and more consistent 1454133823210459140 weekly-thread-2021-43 jordankdalton
https://pbs.twimg.com/media/FCZiei8WYAA_mZQ.jpg
https://pbs.twimg.com/media/FCZiei7XIAEgVSm.jpg
2021-10-29T17:11:34+00:00 create-traits-for-relationships-you-commonly-use-in-your-models-to-make-your-codebase-cleaner-simpler-and-more-consistent

Laravel Tip: Abstract relations you commonly use to a trait. Its a DRY approach that keeps your models thin.