Skip to content

Commit

Permalink
Update LaravelDebugbar.php (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Mar 11, 2024
1 parent 6545c54 commit 67e43ef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,14 @@ function (\Illuminate\Database\Events\ConnectionEstablished $event) {

if ($this->shouldCollect('mail', true) && class_exists('Illuminate\Mail\MailServiceProvider') && $events) {
try {
$this->addCollector(new SymfonyMailCollector());
$events->listen(function (MessageSent $event) {
$this['mail']->addSymfonyMessage($event->sent->getSymfonySentMessage());
$mailCollector = new SymfonyMailCollector();
$this->addCollector($mailCollector);
$events->listen(function (MessageSent $event) use ($mailCollector) {
$mailCollector->addSymfonyMessage($event->sent->getSymfonySentMessage());
});

if ($config->get('debugbar.options.mail.full_log')) {
$this['mail']->showMessageDetail();
$mailCollector->showMessageDetail();
}

if ($this->hasCollector('time') && $config->get('debugbar.options.mail.timeline')) {
Expand Down

0 comments on commit 67e43ef

Please sign in to comment.