laravel orm : where condition on table -> related table -> related table
问题 so here is my database for a book store books : id ,title category : id, title book_category : id , book_id, category_id book_stock : id , book_id , quantity , price considering all the relations are defined in the model , i can query book_stock it goes something like this Stock::with('Book')->get(); but what if i want to get stock of a book in the category = 1 i can use use condition on book Stock::with('Book' , function($q){ $q->where(['title'=>'abc']); })->get(); but how can i filter