. */ declare(strict_types=1); namespace FireflyIII\Notifications\Test; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\SlackMessage; use Illuminate\Notifications\Notification; use Ntfy\Message; use Wijourdil\NtfyNotificationChannel\Channels\NtfyChannel; //use Illuminate\Notifications\Slack\SlackMessage; /** * Class TestNotification */ class TestNotificationNtfy extends Notification { use Queueable; private string $address; /** * Create a new notification instance. */ public function __construct(string $address) { $this->address = $address; } /** * Get the array representation of the notification. * * @param mixed $notifiable * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return array */ public function toArray($notifiable) { return [ ]; } public function toNtfy(mixed $notifiable): Message { $message = new Message(); $message->topic(config('ntfy-notification-channel.topic')); $message->title((string)trans('email.admin_test_subject')); $message->body((string)trans('email.admin_test_message', ['channel' => 'ntfy'])); $message->tags(['white_check_mark', 'ok_hand']); return $message; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return MailMessage */ public function toMail($notifiable) { } /** * Get the Slack representation of the notification. * * @param mixed $notifiable * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * */ public function toSlack($notifiable) { } /** * Get the notification's delivery channels. * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @param mixed $notifiable * * @return array */ public function via($notifiable) { return [NtfyChannel::class]; } }