NodeOffline.php 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 NodeOffline extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. private $name;
  11. private $ip;
  12. public function __construct($name, $ip)
  13. {
  14. $this->name = $name;
  15. $this->ip = $ip;
  16. }
  17. public function via($notifiable)
  18. {
  19. return sysConfig('node_offline_notification');
  20. }
  21. public function toMail($notifiable)
  22. {
  23. return (new MailMessage)
  24. ->subject(trans('notification.node_offline', ['name' => $this->name]))
  25. ->line(trans('notification.node_offline_content', ['name' => $this->name, 'ip' => $this->ip]));
  26. }
  27. public function toArray($notifiable)
  28. {
  29. return [
  30. //
  31. ];
  32. }
  33. }