<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class ProposalStatusNotification extends Notification
{
    use Queueable;
    protected $proposal,$action_type, $addedBy;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($proposal,$action_type, $addedBy)
    {
        $this->proposal         = $proposal;
        $this->action_type    = $action_type;
        $this->addedBy        = $addedBy; 
         
    }

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

    /**
     * Get the mail representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return \Illuminate\Notifications\Messages\MailMessage
     */
    public function toDatabase($notifiable)
    {
        return [
            'proposal'  => $this->proposal,// ticket information
            'action_type' => $this->action_type, // creator
            'addedBy' => $this->addedBy, // creator 
            'user'    => $notifiable // send
        ];
    }

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