Level 14
The second parameter to DB::select(...) is your bindings. This means that you can do this:
DB::select('select * from leads where lead_agent in ?', [$array]);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, i have this query
$array = ["1","2","3"];
Leads::whereIn('lead_agent', $array);
i want to convert this query to a simple db::raw like this
DB::select('select * from leads where???');
i dont know how to pass the $array into the simple db::raw query
Please or to participate in this conversation.