🔥 Laravel Tip: Default Models
Apr 22, 2022
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.
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.
![tip-image-0](https://res.cloudinary.com/dpmeu3otn/image/upload/v1666555118/tips/jfgognoulnbtq29qochb.jpg)
Other tips: