I want to convert this query into Laravel 4 Eloquent.
$query = SELECT * FROM standard_products WHERE frame_category like "%1%" OR
frame_category like "%2%" OR frame_category like "%3%";
Here I have an array
$frame = Array([1]=1,[2]=2,[3]=3);
Requirement:
Using $frame array I want to get same result in Laravel Eloquent
My effort is:
foreach ($frame as $val) {
$match = Standard_product::orWhere('frame_category','like','%'.$val.'%');
}
$match = $match->get()->toArray();
But result of $match is not equal to $query. Please help me to