samedi 25 avril 2020

How to get text Strings order in Laravel project

I would like to sort column like orderBy.

'WC' columns has such data

'AB-1' 'AB-2' 'AB-5' 'AB-300' 'AB-1980' .... etc

Front of "AB-" letter is same. then comes number.

Could you teach me how to write code please?

 public function index()
    {
        $images = ImageGallery::orderBy('wc', 'asc')->get();
        return view('image-gallery',compact('images'));
    }


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

Aucun commentaire:

Enregistrer un commentaire