I am using laravel 6.x, i have rows like this
Plot 4
Plot 5
Plot 2
Plot 4B
Plot 3
Shop 2
Shop 1
I want result like this
Plot 2
Plot 3
Plot 4
Plot 4B
Plot 5
Shop 1
Shop 2
Thanks
I am using laravel 6.x, i have rows like this
Plot 4
Plot 5
Plot 2
Plot 4B
Plot 3
Shop 2
Shop 1
I want result like this
Plot 2
Plot 3
Plot 4
Plot 4B
Plot 5
Shop 1
Shop 2
Thanks
If you're using Laravel you should look at their documentation for collections and their sort method.
Start with creating collections: https://laravel.com/docs/6.x/collections#creating-collections
And then look at sorting: https://laravel.com/docs/6.x/collections#method-sort
That should get you there. If you post details of your attempts so far we can help you get it working.
If you're using an eloquent model to get your data from a database then it will come as a collection already then you simply need to sort by the relevant key eg.
Model::all()->sortBy('column');