Search by

gizburdt / talk

gizburdt

Send notifications to recipients

Package info

github.com/gizburdt/talk

pkg:composer/gizburdt/talk

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

0.3.0 2026-09-19 08:44 UTC

This package is auto-updated.

Last update: 2026-09-19 08:44:29 UTC


README

Latest Version on Packagist Total Downloads Tests Software License

Send notifications to recipients

Installation

You can install the package via composer:

composer require gizburdt/talk

Usage

Discord

Create a webhook in your Discord channel settings. Return DiscordWebhookChannel::class from via() and add a toDiscord() method to your notification:

use Gizburdt\Talk\Discord\DiscordEmbed;
use Gizburdt\Talk\Discord\DiscordMessage;
use Gizburdt\Talk\Discord\DiscordWebhookChannel;

public function via(object $notifiable): array
{
    return [DiscordWebhookChannel::class];
}

public function toDiscord(object $notifiable): DiscordMessage
{
    return DiscordMessage::make('Deployment finished')
        ->username('Deploy bot')
        ->embed(fn (DiscordEmbed $embed) => $embed
            ->title('Production')
            ->color('#22c55e')
            ->field('Duration', '42s', inline: true));
}

Return the webhook URL from routeNotificationFor('discord') on your notifiable:

public function routeNotificationForDiscord(): string
{
    return $this->discord_webhook_url;
}

On-demand notifications work too:

Notification::route('discord', $webhookUrl)->notify(new Deployed);

A failed request (for example an invalid payload) throws an Illuminate\Http\Client\RequestException.

Testing

composer test