The site I'm building uses posts that can belong to many topics in a many-many relationship. I then have pages that aggregate posts based on certain topics. However, on one page in particular, I want to have options to further filter the dataset to only return posts that belong to both the topic specified by the page, and at least one other topic (based on specific needs, arts/crafts, holidays, etc).
Filtering out just the posts assigned to the pagewide topic is simple I just use :
$this-Topic()->Posts()
but I'm running into trouble when I try to further filter the list. If I try : $this-Topic()->Posts()->filter("Topic", $filter)
I get an Uncaught SS_DatabaseException that tells me there's no "Topic" column that my where clause can use. I double-checked the original class, and that's definitely the name of the relation. If I can resolve this issue, scaling it up to including multiple topics to filter by should be simple enough, but I'm not sure what I'm doing wrong.