. */ declare(strict_types=1); namespace FireflyIII\Notifications\Test; use FireflyIII\Notifications\Notifiables\OwnerNotifiable; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; use Illuminate\Support\Facades\Log; use NotificationChannels\Pushover\PushoverChannel; use NotificationChannels\Pushover\PushoverMessage; // use Illuminate\Notifications\Slack\SlackMessage; /** * Class TestNotification */ class OwnerTestNotificationPushover extends Notification { use Queueable; private OwnerNotifiable $owner; public function __construct(OwnerNotifiable $owner) { $this->owner = $owner; } /** * Get the array representation of the notification. * * @SuppressWarnings(PHPMD.UnusedFormalParameter) * * @return array */ public function toArray(OwnerNotifiable $notifiable) { return [ ]; } public function toPushover(OwnerNotifiable $notifiable): PushoverMessage { Log::debug('Now in toPushover()'); return PushoverMessage::create((string)trans('email.admin_test_message', ['channel' => 'Pushover'])) ->title((string)trans('email.admin_test_subject')) ; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function via(OwnerNotifiable $notifiable) { return [PushoverChannel::class]; } }