Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

unitone's avatar

Multi table inheritance

We just to know if any one interested on multi-table inheritance support on the eloquent models?

We find some topics and ready support for single table inheritance, but we think for doctrine like support

class User{
    var $username;
}

class Student extend User{
    var $grade;
}

$s = new Student();
$s->username = "test";
$s->grade = 15;
$s->save();

Now the save method must create a row in the users table, then a row in the students table.

As shown we must being able to access the inherited fields without using relation like this:

$s = Student::find(1);
echo $s->username; // rather than $s->user->username;
echo $s->grade;

Are you interested? Please notify me if you know about any ready implementation

0 likes
8 replies
bashy's avatar

Are you asking for people to give you packages to do this or want to know if people would like this and you'll build it?

unitone's avatar

mmmm, call for interest :)

We nearly finish from the implementation, and will publish it to a github repo soon

7 likes

Please or to participate in this conversation.