如何正确的在 Lumen 中启用 Notification
安装 illuminate/notifications
1 | composer require illuminate/notifications |
bootstrap/app.php
注册服务
1 | $app->register(Illuminate\Notifications\NotificationServiceProvider::class); |
⚠️ 必须在 AppServiceProvider 注册之前,不然自定义
Channel
会无法找到,提升InvalidArgumentException with message 'Driver [xxxx] not supported.'
在 AppServiceProvider.php
注册 Channel
1 | $this->app->make(Illuminate\Notifications\ChannelManager::class)->extend('your-channel', function() { |