Answer the question
In order to leave comments, you need to log in
How do you choose the right inherited models in Laravel?
The products table has a type_id column.
I want to inherit from Product and make different types of products: FirstProduct, NativeProduct, SuperProduct.
Because they all depend on this type in the database, but have different pricing options or the like.
How to do it correctly so that when selecting a set of models, models with the correct class are returned?
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