app->singleton(HookManager::class, function ($app) { $hookManager = new HookManager(); // 注册短信Hook $hookManager->register($app->make(SmsNotificationHook::class)); // 注册邮件Hook $hookManager->register($app->make(MailNotificationHook::class)); // 注册推送Hook $hookManager->register($app->make(PushNotificationHook::class)); return $hookManager; }); } /** * 启动服务 * * @return void */ public function boot(): void { // 可以在这里添加其他启动逻辑 } }