Commit f608157f authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #732 from franzliedke/patch-4

Add a last_query() function to Database connection class.
parents c9a4f5ea b4f07d43
...@@ -133,6 +133,18 @@ class Database { ...@@ -133,6 +133,18 @@ class Database {
{ {
return Database\Connection::$queries; return Database\Connection::$queries;
} }
/**
* Get the last query that was executed.
*
* Returns false if no queries have been executed yet.
*
* @return string
*/
public static function last_query()
{
return Database\Connection::last_query();
}
/** /**
* Register a database connector and grammars. * Register a database connector and grammars.
......
...@@ -332,5 +332,17 @@ class Connection { ...@@ -332,5 +332,17 @@ class Connection {
{ {
return $this->table($method); return $this->table($method);
} }
/**
* Get the last query that was executed.
*
* Returns false if no queries have been executed yet.
*
* @return string
*/
public static function last_query()
{
return end(static::$queries);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment