Entity inheritance You can reduce duplication in your code by using entity inheritance. For example, you have Photo, Question, Post entities: As you can see all those entities have common columns: id, title, description. To reduce duplication and produce a better abstraction we can create a base class called Content for them: All columns (relations, embeds, etc.) from parent entities (parent can extend other…