diff --git a/src/MailViewerServiceProvider.php b/src/MailViewerServiceProvider.php index d578c5a..195417d 100644 --- a/src/MailViewerServiceProvider.php +++ b/src/MailViewerServiceProvider.php @@ -2,9 +2,10 @@ namespace Label84\MailViewer; +use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; -use Label84\MailViewer\Providers\EventServiceProvider; +use Label84\MailViewer\Subscribers\MessageSentSubscriber; class MailViewerServiceProvider extends ServiceProvider { @@ -38,7 +39,7 @@ public function register(): void 'mailviewer' ); - $this->app->register(EventServiceProvider::class); + Event::subscribe(MessageSentSubscriber::class); } protected function registerRoutes(): void diff --git a/src/Subscribers/MessageSentSubscriber.php b/src/Subscribers/MessageSentSubscriber.php new file mode 100644 index 0000000..5fd6d5a --- /dev/null +++ b/src/Subscribers/MessageSentSubscriber.php @@ -0,0 +1,15 @@ +listen(MessageSent::class, [CreateMailViewerItem::class, 'handle']); + } +}