Apologies if this is a dead simple question. I'm coming over from the NoSQL/Firebase world where the solution was generally to just repeat data wherever possible, and from my understanding that is not the approach to take in SQL.
So here's my quandary - I have a hierarchical structure, to where a User has many Gardens, a Garden has many Beds, and a Bed has many Plants. There is, however, another path to the Plant model, to where a Vegetable has many Varieties, and a Variety has many Plants. I have made the updates to the Models to reflect this, using hasMany and belongsTo relationships, and all appear to be working properly. However, since Vegetables are not directly connected to the User, I have not been able to find a way to show all Plants of a certain Vegetable that a User has.
The solution that I have come up with is t https://showbox.tools/ o get all Plants connected to a User where the Vegetable ID equals the id in /vegetable/{:id}. However, because of the nested relationship of User->Garden->Bed->Plant, I don't know of a good way to get all of the Plants for a User without attaching a user_id directly to the plant (going back to my Firebase days). I'm 1000% sure this is something that Laravel apps do all the time, so is there a quick solution to get all of the plants from that nested structure, then filter by vegetable_id or vegetable_name?
Thanks in advance, I'm just getting started with Laravel but already realize how great it is, and how much time I've been wasting with Firebase!