Laravel dynamic relationship attribute
Relationship Methods Vs. Dynamic Properties
If you do not need to add additional constraints to an Eloquent relationship query, you may access the relationship as if it were a property. For example, continuing to use our User and Post example models,...
khangnhd.hashnode.dev1 min read