<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class TwoFactorCode extends Notification
{
    use Queueable;

    public function __construct(public string $code)
    {
    }

    public function via($notifiable): array
    {
        return ['mail'];
    }

    public function toMail($notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject('Your '.brand_name().' login code')
            ->greeting('Login verification')
            ->line('Use this one-time code to finish signing in:')
            ->line('**'.$this->code.'**')
            ->line('This code expires in 10 minutes. If you did not try to sign in, please change your password.');
    }
}
