Browse Source

Add last_query() helper method to Database class, too.

Signed-off-by: Franz Liedke <franz@develophp.org>

Franz Liedke 12 years ago
parent
commit
b4f07d43f5
1 changed files with 12 additions and 0 deletions
  1. 12 0
      laravel/database.php

+ 12 - 0
laravel/database.php

@@ -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.