src/Models/Database.php
public static function getQueryPreview(QueryBuilder $query = null)
	{
		if (empty($query)) {
			return "";
		}

		$sql        = str_replace('?', "'%s'", $query->toSql());
		$bindings   = $query->getBindings();

		return vsprintf($sql, $bindings);
	}
public static function getQueryPreview(QueryBuilder $query = null)
	{
		if (empty($query)) {
			return "";
		}

		$sql        = str_replace('?', "'%s'", $query->toSql());
		$bindings   = $query->getBindings();

		return vsprintf($sql, $bindings);
	}
Get a preview of what query will be run from a query builder.

This DOES NOT run the query so it can be used for debugging potentially memory-intensive queries.

@param QueryBuilder $query
@return string