W
W
WebDev2016-05-19 11:04:20
Laravel
WebDev, 2016-05-19 11:04:20

How to build a table structure correctly?

Hello, tell me how to build the structure correctly so that it is convenient to work.
Now there are 2 tables:
tags (id, name)
and
tags_tree (id, tag_id, parent_id)
This is the tags table and the tags tree table respectively. A tag can have any number of parent tags and any number of child tags.
How to make a structure correctly so that it is convenient to work with them through models?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2016-05-19
@kirill-93

Perhaps such a package https://github.com/lazychaser/laravel-nestedset will do ?
It seems to be just what is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question