Can someone show me how to write this query in Eloquent?
SELECT * FROM `projects` WHERE `id`=\'17\' OR `id`=\'19\'
I am thinking
The best approach for this case is using Laravel's equivalent for SQL's IN().
Project::whereIn('id', [17, 19])->get();
Will be the same as:
SELECT * FROM projects WHERE id IN (17, 19)
This approach is nicer and also more efficient - according to the Mysql Manual, if all values are constants, IN sorts the list and then uses a binary search.