ServersSuspendedNotification.php 1.9 KB

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