NodeBlocked.php 925 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 NodeBlocked extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. private $content;
  11. public function __construct($content)
  12. {
  13. $this->content = $content;
  14. }
  15. public function via($notifiable)
  16. {
  17. return sysConfig('node_blocked_notification');
  18. }
  19. public function toMail($notifiable)
  20. {
  21. return (new MailMessage)
  22. ->subject(trans('notification.node_block'))
  23. ->line(trans('notification.block_report'))
  24. ->line($this->content);
  25. }
  26. public function toCustom($notifiable)
  27. {
  28. return [
  29. 'title' => trans('notification.node_block'),
  30. 'content' => $this->content,
  31. ];
  32. }
  33. }