Comments & Discussion
S
What would you recommend for the inverse of this relation - "belongs to through"? As I know, Laraver doesn't provide method BelongsToThrough
PK
There's a package for this: staudenmeir/belongs-to-through
we have multiple task for the user in the above given condition and I want to filter it out by created at date or specific task for all users which might be assigned on different dates. how to achive that? for the same I am trying with
product>product_variants>daily_stocks. I want to filterdaily_stockon conditions like issued_stock = 100. so expected output are only product with product record anddaily_stockrecords where on the days when100 recordswhere issued.Well, you could use
hasManyThroughand then doProduct::whereHas('daily_stocks', function($query) { $query->where('issued_stock', 100); }maybe?