Laravel like in Eloquent

May 4, 2020

If you want to run query with Like statement using Eloquent you can follow the following example

 $articles = Article::where('title','like', '%' . $request->keyword . '%')->paginate(12);

This is how you write Laravel where like