J
J
Jedi2020-06-20 10:02:34
Laravel
Jedi, 2020-06-20 10:02:34

How to implement content sorting?

I want to implement sorting of post content. For example, it may be that the second content in a row may be created earlier than the first content - Introduction.

Of course, the first thing that comes to mind is the idea to make a sort_id field, and write numerical values ​​there. But it seems to me that this is too primitive, since you can manually write for the second content . It is also possible that sord_id will be repeated. I don't know, I've never experienced this before. How would you implement it? sort_id=7

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-06-20
@PHPjedi

Easier does not mean worse if it solves the problem. Only I would start writing hundreds in the sort field: 100, 200, 300. In case you need to insert something between the elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question