From 4dde6dc33e5df577f480bf4fdcf566219aef2857 Mon Sep 17 00:00:00 2001 From: Recca Tsai Date: Mon, 6 Jun 2016 19:14:51 +0800 Subject: [PATCH] fix datatime object --- src/Panels/DatabasePanel.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Panels/DatabasePanel.php b/src/Panels/DatabasePanel.php index d2a0c36..93b3684 100644 --- a/src/Panels/DatabasePanel.php +++ b/src/Panels/DatabasePanel.php @@ -2,6 +2,7 @@ namespace Recca0120\LaravelTracy\Panels; +use DateTime; use Exception; use PDO; @@ -133,6 +134,10 @@ public function logQuery($prepare, $bindings = [], $time = 0, $name = null, PDO public static function prepareBindings($prepare, $bindings = []) { array_walk($bindings, function (&$binding) { + if ($binding instanceof DateTime) { + $binding = $binding->format('Y-m-d H:i:s'); + } + if (is_string($binding) === true) { $binding = "'".addslashes($binding)."'"; }