Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/RunTracy/Helpers/EloquentORMPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace RunTracy\Helpers;

use DateTime;
use Tracy\IBarPanel;

class EloquentORMPanel implements IBarPanel
Expand Down Expand Up @@ -89,7 +90,11 @@ private function parse($data)
$bind = '<span class="tracy-dump-hash"><hr />';
if (!empty($var['bindings'])) {
foreach ($var['bindings'] as $k => $v) {
$bind .= "[$k => $v]<br />";
$value = $v;
if ($v instanceof DateTime) {
$value = $v->format("Y-m-d H:i:s");
}
$bind .= "[$k => $value]<br />";
}
}
$return .= sprintf(
Expand Down
2 changes: 2 additions & 0 deletions tests/RunTracy/Helpers/EloquentORMPanelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Tests\RunTracy\Helpers;

use DateTime;
use Tests\BaseTestCase;

/**
Expand Down Expand Up @@ -68,6 +69,7 @@ public function testEloquentORMPanelParser()
5 => 0,
6 => 0,
7 => '89a412a4ad6ad9df88b42ca4c12bb271',
8 => new DateTime()
],
'time' => 4.9100000000000001,
];
Expand Down