I have some query that I need to pass to another query using query builder
$query = DB::table(\'table\')->whereIn(\'some_field\', [1,2,30])->toSql(); Mode
$sqlQuery = Str::replaceArray( '?', collect($query->getBindings()) ->map(function ($i) { if (is_object($i)) { $i = (string)$i; } return (is_string($i)) ? "'$i'" : $i; })->all(), $query->toSql());