vito/app/Notifications/AbstractNotification.php
Saeed Vaziry e997d0deea
WIP notifications and other refactors (#88)
* WIP notifications and other refactors
- refactor notification channels
- send notifications on events related to the servers and sites
- delete server log files on server deletion
- add telegram notification channel
- add new icons
- cache configs and icons on installation and updates
- new navbar for dark mode and settings

* discord channel

* build assets

* pint
2024-01-07 09:54:08 +01:00

37 lines
903 B
PHP

<?php
namespace App\Notifications;
use App\Contracts\Notification as NotificationInterface;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Queue\SerializesModels;
abstract class AbstractNotification extends Notification implements NotificationInterface, ShouldQueue
{
use Queueable, SerializesModels;
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage())
->line($this->rawText());
}
public function toSlack(object $notifiable): string
{
return $this->rawText();
}
public function toDiscord(object $notifiable): string
{
return $this->rawText();
}
public function toTelegram(object $notifiable): string
{
return $this->rawText();
}
}