Table filter with a relationship like so?
Well I know it fails with
Call to a member function getRelated() on null
, but thought maybe someone had some ideas. Trying to filter properties that belong to a particular project. Properties dont have a direct relationship to a project as you can see. 7 Replies
Shouldn’t this a be hasManyThrough?
@Dennis Koch that possible without creating an additional table?
Ah, i get what you would think that. I couldnt get a relationship to work on the Projects model for properties. I had to do an attribute like so:
you cant optionally return a relationship
its not a real relationship then
@Dan Harrin makes sense. Im assuming at this point I have to do a custom query builder instead to create such a filter
i wouldnt use a relationship, yeah. custom query() function
ive changed a bit of my app since then, but unfortunately i had to stick with an attribute there
or, use
county.projects
as the relation name