D
D
David2018-04-19 21:13:40
Laravel
David, 2018-04-19 21:13:40

What is the correct way to save an array with to a database using Laravel 5.6?

I have already implemented this task, but I do not like my way, it works slowly.
There is an array of data Product. It has a sub array Categories, Offers.
Created 4 tables:
-products -categories -offers
-products_categories (For linking products to categories) here is a ManyToMany relationship. The question is, maybe Laravel already has ready-made solutions for such tasks. Or do you have to figure it out yourself? I think such situations often arise, maybe there will be ready-made solutions out of the box.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-04-19
@foxit007

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question