12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Notifications\Notification;
- class DynamicNotification extends Notification
- {
- use Queueable;
- /**
- * @var array
- */
- private $via;
- /**
- * @var array
- */
- private $database;
- /**
- * @var MailMessage
- */
- private $mail;
- /**
- * Create a new notification instance.
- *
- * @param array $via
- * @param array $database
- * @param MailMessage $mail
- */
- public function __construct($via, $database, $mail)
- {
- $this->via = $via;
- $this->database = $database;
- $this->mail = $mail;
- }
- /**
- * Get the notification's delivery channels.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function via()
- {
- return $this->via;
- }
- public function toMail()
- {
- return $this->mail;
- }
- /**
- * Get the array representation of the notification.
- *
- * @param mixed $notifiable
- * @return array
- */
- public function toArray()
- {
- return $this->database;
- }
- }
|