LMSouq
php-dev Open

Laravel-5 'LIKE' equivalent (Eloquent)

V4
V4n1ll4
1 month ago
3 views
Problem Description
I'm using the below code to pull some results from the database with Laravel 5. BookingDates::where('email', Input::get('email'))->orWhere('name', 'like', Input::get('name'))->get() However, the orWhereLike doesn't seem to be matching any results. What does that code produce in terms of MySQL statements? I'm trying to achieve something like the following: select * from booking_dates where email='my@email.com' or name like '%John%'

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base