5 years ago

Is table single or multi table inheritance possible with Eloquent?

Posted 5 years ago by CrtlAltDylan

I have an application that's getting pretty large. I've noticed that one of our tables "locations" is doing the job of several tables. There are many sub-locations that inherit the same properties, but are different enough that they justify their own table (because of additional fields).

I've also noticed I need to apply this pattern to another part of my application so it's definitely a pattern worth learning how to do and implementing.

Problem is I don't see any documentation on this type of Eloquent feature. Is single and multiple class inheritance out of scope of the Eloquent ORM? I'm working on implementing the repository pattern, so I could possibly switch out to doctrine which I know supports this.

I'd just rather stick with Eloquent because it's so easy to use. Has anyone else encountered this problem?

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