B
B
BuTOC_902020-03-02 05:17:45
MySQL
BuTOC_90, 2020-03-02 05:17:45

How to sort by number and letters in Laravel?

Hello everyone

, Please tell me how to correctly set the sorting in the Laravel query builder of a string value by number + letter?

For example, there is:
7
13
2b
56rr
6ad

And I want to output in order:
2b
6ad
7
13
56rr

Thank you in advance :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NubasLol, 2020-03-02
@NubasLol

Model::query()->orderBy('column')->get()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question