diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index ea7e658abd4b..5bab008e13da 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -96,9 +96,11 @@ class Builder implements BuilderContract 'avg', 'count', 'dd', + 'ddRawSql', 'doesntExist', 'doesntExistOr', 'dump', + 'dumpRawSql', 'exists', 'existsOr', 'explain', @@ -115,8 +117,8 @@ class Builder implements BuilderContract 'raw', 'rawValue', 'sum', - 'toRawSql', 'toSql', + 'toRawSql', ]; /** diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index f3cf509f4114..b2ca42cdcd1a 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -3910,6 +3910,18 @@ public function dump() return $this; } + /** + * Dump the raw current SQL with embedded bindings. + * + * @return $this + */ + public function dumpRawSql() + { + dump($this->toRawSql()); + + return $this; + } + /** * Die and dump the current SQL and bindings. * @@ -3920,6 +3932,16 @@ public function dd() dd($this->toSql(), $this->getBindings()); } + /** + * Die and dump the current SQL with embedded bindings. + * + * @return never + */ + public function ddRawSql() + { + dd($this->toRawSql()); + } + /** * Handle dynamic method calls into the method. *