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 19:24:25 +02:00

12 lines
No EOL
640 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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