MIF_E31221305/TA_API/app/Notifications/ResetPasswordNotification.php

62 lines
1.4 KiB
PHP

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class ResetPasswordNotification extends Notification
{
use Queueable;
protected $pin;
/**
* Create a new notification instance.
*/
public function __construct($pin)
{
$this->pin = $pin;
}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
$appName = config('app.name', 'Project Jahit');
return (new MailMessage)
->subject('Reset Password - ' . $appName)
->view('emails.reset-password', [
'pin' => $this->pin,
'name' => $notifiable->name,
'appName' => $appName,
'expiresIn' => '60 menit'
]);
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
'pin' => $this->pin,
];
}
}