Answer the question
In order to leave comments, you need to log in
Faker - how to create a category tree?
How to populate category table with structure :
id, name, parent_id, created_at, updated_id ?
Just so that there would not be a situation when category 3 has a child category 5, category 5 has a child 6, and category 6 has a child 3
Answer the question
In order to leave comments, you need to log in
Seeding databases with a factory & faker is not particularly suitable for cases where you need to take into account previous created records. It's easier to do it manually through a loop, as for me.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question