Skip to content

Commit

Permalink
Setting laravel event dispatcher in the connection for logging queries
Browse files Browse the repository at this point in the history
  • Loading branch information
evsign committed Oct 31, 2019
1 parent 53a9462 commit 0bab27d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Integrations/Laravel/ClickhouseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ public function boot()
$db->extend('clickhouse', function ($config, $name) {
$config['name'] = $name;

return new Connection($config);
$connection = new Connection($config);

if ($this->app->bound('events')) {
$connection->setEventDispatcher($this->app['events']);
}

return $connection;
});
}
}

0 comments on commit 0bab27d

Please sign in to comment.