$builder->toSql();
$builder->getBindings();
$query = vsprintf(str_replace(['?'], ['\'%s\''], $builder->toSql()), $builder->getBindings());
блокнот
$builder->toSql();
$builder->getBindings();
$query = vsprintf(str_replace(['?'], ['\'%s\''], $builder->toSql()), $builder->getBindings());