Laravel 5 - like query example using eloquent where clause.

By Hardik Savani | April 28, 2016 | | 95137 Viewer | Category : Laravel

Whenever you require to use select like query in your application then you can easily use. Laravel 5 provide query builder and mysql like condition is very simple to use. So let's see bellow example did convert bellow sql query.

SQL Example:


FROM `users`

WHERE `name` LIKE '%hdtopi%';

Laravel Query Example:

$search = 'hdtopi';

$user = User::where('name','LIKE',"%{$search}%")



***Do you want me hire for your Project Work? Then Contact US.