ServersSuspendedNotification.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 ServersSuspendedNotification extends Notification implements ShouldQueue
  8. {
  9. use Queueable;
  10. /**
  11. * Create a new notification instance.
  12. *
  13. * @return void
  14. */
  15. public function __construct()
  16. {
  17. //
  18. }
  19. /**
  20. * Get the notification's delivery channels.
  21. *
  22. * @param mixed $notifiable
  23. * @return array
  24. */
  25. public function via($notifiable)
  26. {
  27. return ['mail', 'database'];
  28. }
  29. /**
  30. * Get the mail representation of the notification.
  31. *
  32. * @param mixed $notifiable
  33. * @return \Illuminate\Notifications\Messages\MailMessage
  34. */
  35. public function toMail($notifiable)
  36. {
  37. return (new MailMessage)
  38. ->subject(__('Your servers have been suspended!'))
  39. ->greeting(__('Your servers have been suspended!'))
  40. ->line(__('To automatically re-enable your server/s, you need to purchase more credits.'))
  41. ->action(__('Purchase credits'), route('store.index'))
  42. ->line(__('If you have any questions please let us know.'));
  43. }
  44. /**
  45. * Get the array representation of the notification.
  46. *
  47. * @param mixed $notifiable
  48. * @return array
  49. */
  50. public function toArray($notifiable)
  51. {
  52. return [
  53. 'title' => __('Your servers have been suspended!'),
  54. 'content' => '
  55. <h5>'.__('Your servers have been suspended!').'</h5>
  56. <p>'.__('To automatically re-enable your server/s, you need to purchase more credits.').'</p>
  57. <p>'.__('If you have any questions please let us know.').'</p>
  58. <p>'.__('Regards').',<br />'.config('app.name', 'Laravel').'</p>
  59. ',
  60. ];
  61. }
  62. }