Level 35
As far as I know you have to create the ?, ?, ?, ?.. manually in this case if you use raw queries.
$yourData = ['a','b','c'];
// creates ?,?,?
$questionMarks = trim(str_repeat('?,', count($yourData)), ',');
->whereRaw("
something = something_else
column in ({$questionmarks})
", $yourData);
If you don't want to or can't use the ? parameter and need named parameters you could loop over your data and create a string like :val_1, :val_2, :val_3 and than pass your values as [`val_1' => 'a', 'val_2' => 'b', 'val_3' => 'c'];
1 like