diff --git a/laravel/database.php b/laravel/database.php index c5e28ac2..60fd09d1 100644 --- a/laravel/database.php +++ b/laravel/database.php @@ -124,6 +124,19 @@ class Database { { return new Expression($value); } + + /** + * Escape a string for usage in a query. + * + * This uses the correct quoting mechanism for the default database connection. + * + * @param string $value + * @return string + */ + public static function escape($value) + { + return static::connection()->pdo->quote($value); + } /** * Get the profiling data for all queries.