<?php namespace Bixo\Account\Notifications; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Notification; use Bixo\Account\Events\DrcrnoteDetailAction as DrcrnoteDetailActionEvent; use Bixo\Account\Models\DrcrnoteDetail; class DrcrnoteDetailAction extends Notification implements ShouldQueue { use Queueable; protected $event; protected $drcrnote_detail; protected $action; protected $request; /** * Create a new notification instance. * * @param DrcrnoteDetailActionEvent $drcrnote_detail */ public function __construct(DrcrnoteDetailActionEvent $drcrnote_detail) { $this->action = $event->action; $this->drcrnote_detail = $drcrnote_detail; $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('DrcrnoteDetail Approved - ' . config('app.name')) ->view('account::drcrnote_detail.email.action', ['data' => $this->drcrnote_detail]); } /** * Get the notification's delivery channels. * * @param object $notifiable * @return array<int, string> */ public function via(object $notifiable): array { return ['mail']; } }