How can I properly bind an array for a raw query's NOT IN
/ IN
?
The following throws an array to string conversion error:
$user_list_to_exclude = [1, 2, 3];
$data = DB::select("SELECT * FROM users WHERE user_id NOT IN :user_list_to_exclude",
['user_list_to_exclude' => $user_list_to_exclude]);