ConfirmPaymentNotification.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace App\Notifications;
  3. use App\Models\Payment;
  4. use Illuminate\Bus\Queueable;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Notifications\Messages\MailMessage;
  7. use Illuminate\Notifications\Notification;
  8. class ConfirmPaymentNotification extends Notification implements ShouldQueue
  9. {
  10. //THIS IS BASICALLY NOT USED ANYMORE WITH INVOICENOTIFICATION IN PLACE
  11. use Queueable;
  12. private Payment $payment;
  13. /**
  14. * Create a new notification instance.
  15. *
  16. * @return void
  17. */
  18. public function __construct(Payment $payment)
  19. {
  20. $this->payment = $payment;
  21. }
  22. /**
  23. * Get the notification's delivery channels.
  24. *
  25. * @param mixed $notifiable
  26. * @return array
  27. */
  28. public function via($notifiable)
  29. {
  30. return ['mail'];
  31. }
  32. /**
  33. * Get the mail representation of the notification.
  34. *
  35. * @param mixed $notifiable
  36. * @return MailMessage
  37. */
  38. public function toMail($notifiable)
  39. {
  40. return (new MailMessage)
  41. ->subject(__('Payment Confirmation'))
  42. ->markdown('mail.payment.confirmed', ['payment' => $this->payment]);
  43. }
  44. /**
  45. * Get the array representation of the notification.
  46. *
  47. * @param mixed $notifiable
  48. * @return array
  49. */
  50. public function toArray($notifiable)
  51. {
  52. return [
  53. 'title' => __('Payment Confirmed!'),
  54. 'content' => __('Payment Confirmed!'),
  55. ];
  56. }
  57. }