2 years ago

House polymorphic relation with Elements (bricks, windows, doors)

Posted 2 years ago by kickthemooon

E.g. I have a Model House and I want to have a many to many relation with Elements which could be bricks, windows doors or other elements. And when I call a method, e.g. getElements() on a House object I want to get all of the elements whether they are bricks, windows or doors.

Is this possible with Eloquent?

Please sign in or create an account to participate in this conversation.