laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

Eloquent multi-table inheritance #2573

Closed CristianH033 closed 3 years ago

CristianH033 commented 3 years ago

Hi everyone. Could we have a native implementation of multi-table inheritance for eloquent or is there a way to achieve this?. I think it is a very important database architecture and it is implemented in many other web frameworks including the Doctrine ORM. So far I have found only one package that adds this functionality to Laravel: https://github.com/cvsouth/eloquent-inheritance. But I don't know how much longer this package will be maintained.

rimace commented 3 years ago

I'm against this. It adds a very complex code while the benefits are small. I guess this is a functionality that is better provided by a package instead of making this a standard Laravel behaviour. Besides code quality of this specific project is terrible.

ollieread commented 3 years ago

I'm with @rimace on this. The actual features you're looking at can be achieved relatively easily, I've done it once or twice, but would likely be best as a package, if only to avoid adding more bloat to the base model, which is already a bit of a chungus. Also that packages coding is all over the place, and doesn't inspire much confidence.