V
V
Vladimir Singhtlov2018-07-13 12:42:50
Laravel
Vladimir Singhtlov, 2018-07-13 12:42:50

How to link two models to one model?

Example:
Two models of glass and a frame, each model has a brand and it is in the same table, but divided by model type.
We create a new brand, where the type is specified as the name of the model. How to implement this connection?
Actually it's morphTo only without type_id

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-07-13
@Yan-s

https://laravel.ru/docs/v5/eloquent-relationships#pl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question