NotifyCompletedRequest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Notifications\Messages\MailMessage;
  6. use Illuminate\Notifications\Notification;
  7. class NotifyCompletedRequest extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. private $content;
  11. /**
  12. * Create a new notification instance.
  13. *
  14. * @return void
  15. */
  16. public function __construct($content)
  17. {
  18. $this->content = $content;
  19. }
  20. /**
  21. * Get the notification's delivery channels.
  22. *
  23. * @param mixed $notifiable
  24. * @return array
  25. */
  26. public function via($notifiable)
  27. {
  28. return ['mail'];
  29. }
  30. /**
  31. * Get the mail representation of the notification.
  32. *
  33. * @param mixed $notifiable
  34. * @return \Illuminate\Notifications\Messages\MailMessage
  35. */
  36. public function toMail($notifiable)
  37. {
  38. return (new MailMessage)->markdown('emails.notifyCompletedRequest', ['content' => $this->content]);
  39. }
  40. /**
  41. * Get the array representation of the notification.
  42. *
  43. * @param mixed $notifiable
  44. * @return array
  45. */
  46. public function toArray($notifiable)
  47. {
  48. return [
  49. //
  50. ];
  51. }
  52. }