refactor: remove SendsWebhook interface
Simplified webhook channel implementation to match TelegramChannel pattern without typed interface. Changes: - Removed SendsWebhook interface file - Removed interface from Team model - Removed routeNotificationForWebhook() method - WebhookChannel now uses untyped $notifiable like TelegramChannel 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
dc15bee980
commit
556d93ecb8
3 changed files with 2 additions and 16 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
use App\Notifications\Channels\SendsEmail;
|
use App\Notifications\Channels\SendsEmail;
|
||||||
use App\Notifications\Channels\SendsPushover;
|
use App\Notifications\Channels\SendsPushover;
|
||||||
use App\Notifications\Channels\SendsSlack;
|
use App\Notifications\Channels\SendsSlack;
|
||||||
use App\Notifications\Channels\SendsWebhook;
|
|
||||||
use App\Traits\HasNotificationSettings;
|
use App\Traits\HasNotificationSettings;
|
||||||
use App\Traits\HasSafeStringAttribute;
|
use App\Traits\HasSafeStringAttribute;
|
||||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
|
|
@ -37,7 +36,7 @@
|
||||||
]
|
]
|
||||||
)]
|
)]
|
||||||
|
|
||||||
class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, SendsSlack, SendsWebhook
|
class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, SendsSlack
|
||||||
{
|
{
|
||||||
use HasFactory, HasNotificationSettings, HasSafeStringAttribute, Notifiable;
|
use HasFactory, HasNotificationSettings, HasSafeStringAttribute, Notifiable;
|
||||||
|
|
||||||
|
|
@ -167,11 +166,6 @@ public function routeNotificationForPushover()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function routeNotificationForWebhook()
|
|
||||||
{
|
|
||||||
return data_get($this, 'webhook_url', null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getRecipients(): array
|
public function getRecipients(): array
|
||||||
{
|
{
|
||||||
$recipients = $this->members()->pluck('email')->toArray();
|
$recipients = $this->members()->pluck('email')->toArray();
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Notifications\Channels;
|
|
||||||
|
|
||||||
interface SendsWebhook
|
|
||||||
{
|
|
||||||
public function routeNotificationForWebhook();
|
|
||||||
}
|
|
||||||
|
|
@ -10,7 +10,7 @@ class WebhookChannel
|
||||||
/**
|
/**
|
||||||
* Send the given notification.
|
* Send the given notification.
|
||||||
*/
|
*/
|
||||||
public function send(SendsWebhook $notifiable, Notification $notification): void
|
public function send($notifiable, Notification $notification): void
|
||||||
{
|
{
|
||||||
$webhookSettings = $notifiable->webhookNotificationSettings;
|
$webhookSettings = $notifiable->webhookNotificationSettings;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue