How to fetch records that specfic strings in Laravel?

I would like to fetch record that a columun has specfic strings. My Laravel framework is 5.7.28

Here is my DB. Take a look 'image' columun.

For example. I would like to fetch record that 'images' name include '01' strings. I give name all image data those front 2 letters are numbers such as '01', '02', '03' ....

Could you please teach me how to write controller code?

Here is my current controller

public function index2()
{
$images = ImageGallery::orderBy(DB::raw('LENGTH(image), image'))->paginate(10);
return view('image-gallery2',compact('images'));
}

enter image description here



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

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time