Can someone show me how to write this query in Eloquent?
SELECT * FROM `projects` WHERE `id`=\'17\' OR `id`=\'19\'
I am thinking
In laravel 5 you could do it this way.
$projects = Projects::query();
foreach ($selects as $select) {
$projects->orWhere('id', '=', $select);
}
$result = $projects->get();
This is very useful specially if you have custom methods on your Projects model and you need to query from variable. You cannot pass $selects
inside the orWhere method.