You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
874 B

  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Notifications\Notification;
  5. class DBNotification extends Notification
  6. {
  7. use Queueable;
  8. public $message;
  9. /**
  10. * Create a new notification instance.
  11. *
  12. * @return void
  13. */
  14. public function __construct($message)
  15. {
  16. $this->message = $message;
  17. }
  18. /**
  19. * Get the notification's delivery channels.
  20. *
  21. * @param mixed $notifiable
  22. * @return array
  23. */
  24. public function via($notifiable)
  25. {
  26. return ['database'];
  27. }
  28. /**
  29. * Get the array representation of the notification.
  30. *
  31. * @param mixed $notifiable
  32. * @return array
  33. */
  34. public function toArray($notifiable)
  35. {
  36. return [
  37. 'data' => $this->message['body'],
  38. 'business_id' => 1
  39. ];
  40. }
  41. }