I have the tables
Orders (have enquiry_id, shop_id a foreign key in it)
hasOne/hasManyOrders. because many shops can buy the same enquiry.
Now I am trying to make appropriate relationship function in the models so that; I can fetch all enquiries belongs to a shop and having the orders entry in the Orders table for that shop, and further filter on enquiry future dates (means not past dates to be fetched.);
I tried passing shopId to the relationship function in Enquiry model. but don't how to further pass it to the Orders table.