mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 21:34:03 +00:00
561 B
561 B
| title | tweet_id | thread_slug | author_username | images | created_at | slug | |
|---|---|---|---|---|---|---|---|
| You can define default model data for BelongsTo relationships | 1520040284783972352 | weekly-thread-2022-17 | cosmeescobedo |
|
2022-04-29T14:00:19+00:00 | you-can-define-default-model-data-for-belongsto-relationships |
🔥 Laravel Tip: Default Models.
In your relationships, you can define default models.
That way if the relationship doesn't exist it will return a default model so you don't have to check if is null every time.