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-single-use-traits.md
2021-04-07 20:16:47 +02:00

529 B

title tweet_id thread_slug author_username images created_at slug
Create single-use traits 1272822478260363265 laravel-clean-code-tactics samuelstancl
https://pbs.twimg.com/media/Ean5BnEWkAEPUTe.jpg
2020-06-16T09:25:01+00:00 create-single-use-traits

Adding methods to classes where they belong is cleaner than creating action classes for everything, but it can make the classes grow big

Consider using traits. They're meant primarily for code reuse, but there's nothing wrong with single-use traits