🔥 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.
Other tips: