Skip to content

Commit 1f5f617

Browse files
committed
Adding typecheck for Laravel's QueryExecuted event rather than version check.
1 parent 9e73be3 commit 1f5f617

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/LaravelDebugbar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ function ($query, $bindings = null, $time = null, $connectionName = null) use ($
295295
// Laravel 5.2 changed the way some core events worked. We must account for
296296
// the first argument being an "event object", where arguments are passed
297297
// via object properties, instead of individual arguments.
298-
if (version_compare($this->version, '5.2.0', '>=')) {
298+
// In my opinion it is better to type check rather than version check for the
299+
// long term.
300+
if ( $query instanceof \Illuminate\Database\Events\QueryExecuted ) {
299301
$bindings = $query->bindings;
300302
$time = $query->time;
301303
$connection = $query->connection;

0 commit comments

Comments
 (0)