My query is like this :
$search = $request->get('search');
$search_date = $request->get('search_date');
$store = Store::whereDate('updated_at', $search_date)->orWhereHas('user'), function($query) use ($search) {
$query->where(function ($q) use($search)
{
$q->where('name', 'LIKE', '%',$search.'%');
});
})->paginate(10);
When executed, there is no error. But the result not match with the filter date
When I only use wheredate without wherehas, it's match with the filter
What the wheredate
and wherehas
is not can run simultaneously?
Update
I have 2 input text, that is input text for datepicker and input text to search name. When the user wants to do searching, he can input updated date and input name. Then click the search button. And the system will filter it out.
and
conjunctions, don't useor
. – Alex Blex