Answer the question
In order to leave comments, you need to log in
How to sort selection in Laravel by value in table?
There is a table:
| id | name | role |
|----|---------|-------|
| 1 | John | admin |
| 2 | Tom | user |
| 3 | Paul | user |
| 4 | Mikle | moder |
| 5 | Lindsey | admin |
role
are in this order when displayed: Answer the question
In order to leave comments, you need to log in
Read about sorting in the documentation. Everything works the same way with eloquent.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question