Answers for "eloquent get sql with bindings"

PHP
0

eloquent to sql with bindings

$query = DB::table('table')->whereIn('some_field', [1,2,30]);

$sql = $query->toSql();

$bindings = $query->getBindings();
Posted by: Guest on May-16-2021
0

eloquent to sql with bindings

public static function getQueries(Builder $builder)
{
    $addSlashes = str_replace('?', "'?'", $builder->toSql());
    return vsprintf(str_replace('?', '%s', $addSlashes), $builder->getBindings());
}
Posted by: Guest on May-16-2021

Code answers related to "eloquent get sql with bindings"

Browse Popular Code Answers by Language