- Laravel Version:8.70.1
- PHP Version: 8.0
- Database Driver & Version: Mysql 8.0
Description:
Take the following query:
DB::table('whatever')
->selectRaw("SUM('case(`status` in (?)) as total_pending", [[1,2,3]])
->where('user', 1)
->groupBy('something')
->get()
When laravel runs this query, the bindings are flattened, which results in
SELECT SUM('case(`status` in (1)) as total_pending from whatever where user = 2 group by something
Possibly a security issue if query params are passed into a select raw? see #35865
Anyhow, I don't see why array bindings flattened, as they are supported by the database.