use App\Models\Ticket;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class TicketReplied extends Notification
{
use Queueable;
public $ticket;
public function __construct(Ticket $ticket)
{
$this->ticket = $ticket;
}
public function via($notifiable)
{
return ['mail', 'database'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->line('The introduction to the notification.')
->action('Notification Action', url('/'))
->line('Thank you for using our application!');
}
public function toArray($notifiable)
{
return [
'title' => __('bap.new_ticket_replied') . $this->ticket->id,
'url' => route('panel.support.ticket.view', [$this->ticket->id]),
];
}
}