mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
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
This commit is contained in:
36
app/Notifications/AbstractNotification.php
Normal file
36
app/Notifications/AbstractNotification.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user