Browse Source

Add a last_query() function to Database connection class.

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

+ 12 - 0
laravel/database/connection.php

@@ -322,5 +322,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);
+	}
 
 
 }
 }