ProposalStatusNotification.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Notifications\Notification;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Notifications\Messages\MailMessage;
  7. class ProposalStatusNotification extends Notification
  8. {
  9. use Queueable;
  10. protected $proposal,$action_type, $addedBy;
  11. /**
  12. * Create a new notification instance.
  13. *
  14. * @return void
  15. */
  16. public function __construct($proposal,$action_type, $addedBy)
  17. {
  18. $this->proposal = $proposal;
  19. $this->action_type = $action_type;
  20. $this->addedBy = $addedBy;
  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 ['database'];
  31. }
  32. /**
  33. * Get the mail representation of the notification.
  34. *
  35. * @param mixed $notifiable
  36. * @return \Illuminate\Notifications\Messages\MailMessage
  37. */
  38. public function toDatabase($notifiable)
  39. {
  40. return [
  41. 'proposal' => $this->proposal,// ticket information
  42. 'action_type' => $this->action_type, // creator
  43. 'addedBy' => $this->addedBy, // creator
  44. 'user' => $notifiable // send
  45. ];
  46. }
  47. /**
  48. * Get the array representation of the notification.
  49. *
  50. * @param mixed $notifiable
  51. * @return array
  52. */
  53. public function toArray($notifiable)
  54. {
  55. return [
  56. //
  57. ];
  58. }
  59. }