Skip to content

Commit 15de1f0

Browse files
committed
Fix: collecting sql queries
1 parent ce3d9ac commit 15de1f0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Breadcrumbs.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public function add($data)
2424
$this->breadcrumbs [] = $data;
2525
}
2626

27+
public function push($key, $value)
28+
{
29+
$this->breadcrumbs[$key][] = $value;
30+
}
31+
2732
public function getBreadcrumbs()
2833
{
2934
return $this->breadcrumbs;

src/EventHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class EventHandler
7171
* @var \Illuminate\Contracts\Events\Dispatcher
7272
*/
7373
private $events;
74-
74+
7575
/**
7676
* EventHandler constructor.
7777
* @param \Illuminate\Contracts\Events\Dispatcher $events
@@ -227,7 +227,7 @@ protected function queryHandler($query, $bindings, $time, $connectionName)
227227
$data['query'] = vsprintf(str_replace(['?'], ['\'%s\''], $query), $bindings);;
228228

229229
Breadcrumbs::getInstance()
230-
->add(['sql' => $data]);
230+
->push('sql', $data);
231231
}
232232

233233
/**
@@ -247,7 +247,7 @@ protected function queryExecutedHandler(QueryExecuted $query)
247247
$data['query'] = vsprintf(str_replace(['?'], ['\'%s\''], $query->sql), $query->bindings);;
248248

249249
Breadcrumbs::getInstance()
250-
->add(['sql' => $data]);
250+
->push('sql', $data);
251251
}
252252

253253
/**

0 commit comments

Comments
 (0)