T
T
Tokenchik2018-06-01 13:29:34
Laravel
Tokenchik, 2018-06-01 13:29:34

How to paginate and sort posts by parent and child?

There is a table of categories, with the parent identifier through parent_id, the nesting level is not specified.
How to get all entries like:
Parent
--child
--child
----subChild
----subChild
Parent
--child
And then apply paginate() to them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
netrox, 2018-06-01
@Tokenchik

You can create a hierarchy using recursion.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question