Skip to content

Commit b4f07d4

Browse files
committed
Add last_query() helper method to Database class, too.
Signed-off-by: Franz Liedke <franz@develophp.org>
1 parent 98b9898 commit b4f07d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

laravel/database.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ public static function profile()
133133
{
134134
return Database\Connection::$queries;
135135
}
136+
137+
/**
138+
* Get the last query that was executed.
139+
*
140+
* Returns false if no queries have been executed yet.
141+
*
142+
* @return string
143+
*/
144+
public static function last_query()
145+
{
146+
return Database\Connection::last_query();
147+
}
136148

137149
/**
138150
* Register a database connector and grammars.

0 commit comments

Comments
 (0)