Answer the question
In order to leave comments, you need to log in
How to organize model hierarchy in Eloquent?
I used to work with Doctrine ORM - everything was obvious there: you create entity classes (with inheritance from the base class, without - no difference) - then you automatically synchronize them with tables (each non-abstract class has its own table).
In Eloquent, nothing is clear: a migration is created for each table, the table defines the model (we do not prescribe properties in the model at all). But what if I have two Pages and Articles models that have properties in common that I want to put into the base Entry abstract model? At the same time, I want to have two tables: Pages and Articles, whose identical fields then will not need to be edited separately. I did not find in the documentation how to implement it.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question