symfony/microsoft-teams-notifier
Symfony Notifier bridge for Microsoft Teams Incoming Webhooks. Configure via MICROSOFT_TEAMS_DSN and send ChatMessage notifications, with support for MessageCard options like sections, facts, and interactive actions/inputs.
Notification system lacks this granularity, making this package a clear upgrade for Teams-specific needs.microsoftteams://default/PATH) for webhook setup, which is simple but requires:
.env or a secrets manager).symfony/notifier (v6.4+ or v7.4+).symfony/mime, symfony/http-client (for HTTP requests).MessageSentEvent), which Laravel’s native Notification system does not. A custom event listener may be needed for observability.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony Dependency Bloat | High | Isolate the package in a Laravel microservice or use Laravel’s Symfony Bridge. |
| PHP Version Mismatch | Medium | Upgrade Laravel to Laravel 10.x (PHP 8.1+) or pin Symfony Notifier to a compatible version. |
| Webhook Rate Limits | Medium | Implement exponential backoff in the transport layer (Symfony Notifier supports this). |
| MessageCard Complexity | Low | Use pre-built templates for common use cases (e.g., alerts, approvals). |
| Lack of Laravel Docs | High | Create internal runbooks for setup, error handling, and message formatting. |
| Vendor Lock-in | Low | MIT license allows forking; design a wrapper service to abstract Symfony dependencies. |
Notification channels (e.g., TeamsViaHookChannel) or third-party packages (e.g., spatie/laravel-teams)?Laravel Native Option (Low Effort, Limited Features):
Notification facade with a custom TeamsViaHookChannel.use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Http;
class TeamsNotification extends Notification {
public function via($notifiable) {
return ['teams'];
}
public function toTeams($notifiable) {
return [
'text' => 'Deployment failed!',
// No rich formatting possible
];
}
}
Symfony Notifier Bridge (High Effort, High Features):
symfony/microsoft-teams-notifier via a Laravel service provider.composer require symfony/notifier symfony/microsoft-teams-notifier
Chatter interface.use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\MicrosoftTeamsTransport;
use Symfony\Component\Notifier\Message\ChatMessage;
$notifier = new Notifier([new MicrosoftTeamsTransport(env('MICROSOFT_TEAMS_DSN'))]);
$notifier->send((new ChatMessage('Alert: High CPU usage!'))
->transport('microsoftteams')
);
Hybrid Approach (Recommended for TPMs):
Phase 1: Proof of Concept (1–2 Days)
Notification channel (simple).Phase 2: Feature Parity (3–5 Days)
Phase 3: Productionization (1 Week)
| Laravel Feature | Symfony Notifier Support | Workaround |
|---|---|---|
| Queue System | Yes (via Messenger) | Bridge Laravel queues to Symfony Messenger or use a custom transport. |
| Events & Observability | Yes (e.g., MessageSentEvent) |
Listen to Symfony events |
How can I help you explore Laravel packages today?