php - Laravel-5 'LIKE' equivalent (Eloquent) -
i'm using below code pull results database laravel 5.
bookingdates::where('email', input::get('email'))->orwhere('name', 'like', input::get('name'))->get()
however, orwherelike doesn't seem matching results. code produce in terms of mysql statements?
i'm trying achieve following:
select * booking_dates email='my@email.com' or name '%john%'
thanks in advance.
if want see run in database use dd(db::getquerylog())
see queries run.
try this
bookingdates::where('email', input::get('email')) ->orwhere('name', 'like', '%' . input::get('name') . '%')->get();
Comments
Post a Comment