ctrlpanel/app/Notifications/ConfirmPaymentNotification.php

67 lines
1.5 KiB
PHP
Raw Normal View History

<?php
namespace App\Notifications;
use App\Models\Payment;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ConfirmPaymentNotification extends Notification implements ShouldQueue
{
2021-12-01 11:19:06 +00:00
//THIS IS BASICALLY NOT USED ANYMORE WITH INVOICENOTIFICATION IN PLACE
use Queueable;
private Payment $payment;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct(Payment $payment)
{
$this->payment = $payment;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
2021-12-13 14:46:04 +00:00
->subject(__('Payment Confirmation'))
->markdown('mail.payment.confirmed', ['payment' => $this->payment]);
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'title' => __('Payment Confirmed!'),
'content' => __('Payment Confirmed!'),
];
}
}