Laravel Like Query Example using Eloquent Where Clause
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:
SELECT *
FROM `users`
WHERE `name` LIKE '%hdtopi%';
Laravel Query Example:
$search = 'hdtopi';
$user = User::where('name','LIKE',"%{$search}%")
->get();
print_r($user);

Hardik Savani
I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.