diff --git a/src/WithMailInterceptor.php b/src/WithMailInterceptor.php index 7c24133..a63a362 100644 --- a/src/WithMailInterceptor.php +++ b/src/WithMailInterceptor.php @@ -44,9 +44,9 @@ public function interceptMail() public function interceptedMail(): Collection { $swiftTransport = (version_compare(app()->version(), '7.0.0', '<')) - ? app('swift.transport') + ? app('swift.transport')->driver() : (app('mailer')->getSwiftMailer())->getTransport(); - return $swiftTransport->driver()->messages(); + return $swiftTransport->messages(); } }