Project created to decouple the sending of messages to disagree, and in this way keep the project without fixed dependency. Sending messages through the discord hook can facilitate the communication of errors, warn when a tariff ends, among many benefits.
- Send message to channel discord with hook
- Send message to multiple channel discord with hook
- Integration Notification Laravel
Laravel Discord Message requires PHP Laravel v8+ to run.
Install the package
composer require frf/discord-notification
After install - Create Discord Hook
DISCORD_HOOK=https://discord.com/api/webhooks/4334343/XaFx43434343lGHYvQHoQO0ykhGRibx3w
php artisan discord:send_message Teste
php artisan discord:send_message Teste warning
Remembering that there is no better place on the controller 😅, I put it just as a practical example
<?php
use Frf\DiscordNotification\Services\DiscordService;
use Illuminate\Support\Facades\Route;
Route::get('/', function (DiscordService $discordService) {
$discordService
->title('Mensagem Teste')
->description('Descricao')
->footer('Footer')
->success()
->timestamp(Carbon::now())
->send();
return view('welcome');
});
MIT
Free Software, Hell Yeah!