<?php namespace Litecms\Currency\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Litecms\Currency\Events\CurrencyAction as CurrencyActionEvent; use Litecms\Currency\Models\Currency; class CurrencyAction extends Notification implements ShouldQueue { use Queueable; protected $event; protected $currency; protected $action; protected $request; /** * Create a new notification instance. * * @param CurrencyActionEvent $currency */ public function __construct(CurrencyActionEvent $currency) { $this->action = $event->action; $this->currency = $currency; $this->request = $event->request; $this->event = $event; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage) ->subject('Currency Approved - ' . config('app.name')) ->view('currency::currency.email.action', ['data' => $this->currency]); } /** * Get the notification's delivery channels. * * @param object $notifiable * @return array<int, string> */ public function via(object $notifiable): array { return ['mail']; } }