jeudi 27 août 2020

Sort by Last Title Word

Simple question - how do I order 'id' descending by last word.

The relevant part of my controller looks like this:

$images   = Images::where('status', 'active')
                ->where('categories_id',$category->id)
                ->orderBy('id','DESC')
                ->paginate($settings->result_request)
                ->onEachSide(1);

For Example :

  1. John AA
  2. Kane AAA
  3. Matt AC
  4. Caesey AAB
  5. Morris AB

It should be like ;

  1. John AA
  2. Morris AB
  3. Matt AC
  4. Kane AAA
  5. Caesey AAB


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2EpQJzI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire