| @@ 32-74 (lines=43) @@ | ||
| 29 | use Illuminate\Contracts\Queue\ShouldQueue; |
|
| 30 | use Illuminate\Notifications\Messages\MailMessage; |
|
| 31 | ||
| 32 | class AddedToServer extends Notification implements ShouldQueue |
|
| 33 | { |
|
| 34 | use Queueable; |
|
| 35 | ||
| 36 | public $server; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Create a new notification instance. |
|
| 40 | * |
|
| 41 | * @param array $server |
|
| 42 | * @return void |
|
| 43 | */ |
|
| 44 | public function __construct(array $server) |
|
| 45 | { |
|
| 46 | $this->server = (object) $server; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * Get the notification's delivery channels. |
|
| 51 | * |
|
| 52 | * @param mixed $notifiable |
|
| 53 | * @return array |
|
| 54 | */ |
|
| 55 | public function via($notifiable) |
|
| 56 | { |
|
| 57 | return ['mail']; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Get the mail representation of the notification. |
|
| 62 | * |
|
| 63 | * @param mixed $notifiable |
|
| 64 | * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 65 | */ |
|
| 66 | public function toMail($notifiable) |
|
| 67 | { |
|
| 68 | return (new MailMessage) |
|
| 69 | ->greeting('Hello ' . $this->server->user . '!') |
|
| 70 | ->line('You have been added as a subuser for the following server, allowing you certain control over the server.') |
|
| 71 | ->line('Server Name: ' . $this->server->name) |
|
| 72 | ->action('Visit Server', route('server.index', $this->server->uuidShort)); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||
| @@ 32-75 (lines=44) @@ | ||
| 29 | use Illuminate\Contracts\Queue\ShouldQueue; |
|
| 30 | use Illuminate\Notifications\Messages\MailMessage; |
|
| 31 | ||
| 32 | class RemovedFromServer extends Notification implements ShouldQueue |
|
| 33 | { |
|
| 34 | use Queueable; |
|
| 35 | ||
| 36 | public $server; |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Create a new notification instance. |
|
| 40 | * |
|
| 41 | * @param array $server |
|
| 42 | * @return void |
|
| 43 | */ |
|
| 44 | public function __construct(array $server) |
|
| 45 | { |
|
| 46 | $this->server = (object) $server; |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * Get the notification's delivery channels. |
|
| 51 | * |
|
| 52 | * @param mixed $notifiable |
|
| 53 | * @return array |
|
| 54 | */ |
|
| 55 | public function via($notifiable) |
|
| 56 | { |
|
| 57 | return ['mail']; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Get the mail representation of the notification. |
|
| 62 | * |
|
| 63 | * @param mixed $notifiable |
|
| 64 | * @return \Illuminate\Notifications\Messages\MailMessage |
|
| 65 | */ |
|
| 66 | public function toMail($notifiable) |
|
| 67 | { |
|
| 68 | return (new MailMessage) |
|
| 69 | ->error() |
|
| 70 | ->greeting('Hello ' . $this->server->user . '.') |
|
| 71 | ->line('You have been removed as a subuser for the following server.') |
|
| 72 | ->line('Server Name: ' . $this->server->name) |
|
| 73 | ->action('Visit Panel', route('index')); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||