S
S
Sergey Kotov2020-01-24 08:04:12
Laravel
Sergey Kotov, 2020-01-24 08:04:12

How to correctly display data from multiple sql tables in Laravel?

I have three tables: Product, Categories, Product_properties.
The product has a name, price, discount, url, photo, category id.
In Categories the names of the categories, and the Product_properties id of the product, and html.
Should I create one model and display all the data in joins, or create three models for each table and combine them somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Barsukov, 2020-01-24
@slavabars

Three models and set up links between them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question