symfony/gitter-notifier
Symfony Notifier integration for Gitter. Configure a GITTER_DSN with your Gitter token and room ID (gitter://TOKEN@default?room_id=ROOM_ID) to send notifications to a Gitter room via the Symfony Notifier system.
HttpClient and dependency injection. The lack of significant changes in v6.4.24 confirms this is still a Symfony Bridge rather than a Laravel-native solution./v1/rooms/{room}/chatMessages) and replace with a webhook or alternative service.GitterNotifierInterface).laravel-notification-channels/discord, spatie/laravel-webhooks)symfony/http-client, symfony/event-dispatcher). No updates to Laravelize.| Component | Symfony Fit | Laravel Fit (Workaround) |
|---|---|---|
| Dependency Injection | Native (Symfony DI) | Unchanged: Requires custom provider or Illuminate\Container bridge |
| HTTP Client | Built-in (symfony/http-client) |
Unchanged: Use Guzzle or Symfony HTTP Client via facade |
| Event System | Symfony Events | Unchanged: Laravel Events or manual dispatch |
| Configuration | services.yaml |
Unchanged: .env + config file or Symfony-style YAML |
Symfony (Unchanged):
composer require symfony/gitter-notifier:v6.4.24.config/packages/gitter_notifier.yaml.GitterNotifier service.Laravel (Unchanged):
composer require symfony/http-client.GitterNotifier (same as before).Http client.// app/Services/ChatNotifier.php (Abstracted)
interface ChatNotifierInterface {
public function send(string $room, string $message);
}
class GitterNotifier implements ChatNotifierInterface {
public function send(string $room, string $message) {
// Fallback to webhook or alternative
if (!app()->environment('production')) {
throw new \RuntimeException("Gitter API is deprecated. Use webhook fallback.");
}
return Http::post("https://api.gitter.im/v1/rooms/{$room}/chatMessages", ['text' => $message]);
}
}
symfony/event-dispatcher) if using Option A./v1/rooms/{room}/chatMessages).Notification facade with a custom channel:
// app/Providers/RouteServiceProvider.php
Notification::route('gitter', 'room-id-here');
GitterNotifier::dispatch($room, $message)->onQueue('notifications');
spatie/laravel-webhooks (for custom integrations).laravel-notification-channels/discord (for modern alternatives).retry helper or Symfony’s HttpClient middleware.// app/Jobs/SendGitterNotification.php
public function handle()
{
try {
$notifier = app(GitterNotifier::class);
$notifier->send($this->room, $this->message);
} catch (\Exception $e) {
Log::error("Gitter fallback failed: " . $e->getMessage());
// Fallback to webhook
Http::post(config('services.webhook.url'), ['message' => $this->message]);
}
}
| Failure Scenario | Impact | Mitigation | |--------------------------------|---------------------------------
How can I help you explore Laravel packages today?