This Laravel Discord package allows you to send messages through a webhook via Laravel Notification Channels and it supports either Discord or Slack style payloads.
Here is an example of how you might send a notification:
public function toDiscord($notifiable)
{
return (new DiscordMessage)
->from('Laravel')
->content('Content')
->embed(function ($embed) {
$embed->title('Discord is cool')->description('Slack nah')
->field('Laravel', '7.0.0', true)
->field('PHP', '8.0.0', true);
});
}
For complete details check out the Github repo for the Laravel Discord channel.
This package was originally submitted to our Laravel Links section. Follow along on Twitter @LaravelLinks