<?php

namespace App\Notifications\Backend;

use App\Models\SettingManagement\Contact;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class ContactCreatedNotification extends Notification {
    use Queueable;

    public $contact;
    public function __construct(Contact $contact){
        $this->contact = $contact;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable){
        return ['mail'];
    }

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return MailMessage
     */
    public function toMail($notifiable){
        $user = $notifiable;
        $contact = $this->contact;
        return (new MailMessage)
                    ->subject(strtoupper(__("Contact Form")))
                    ->markdown("emails.backend.contact",compact("user","contact"))

            ;
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            //
        ];
    }
}
