<?php

namespace App\Mail;

use App\Models\User;
use Illuminate\Mail\Mailable;

class PasswordResetMail extends Mailable
{
    public User $user;
    public string $password;

    public function __construct(User $user, string $password)
    {
        $this->user = $user;
        $this->password = $password;
    }

    public function build()
    {
        return $this
            ->subject('Votre nouveau mot de passe sur ' . config('app.name'))
            ->view('emails.password_reset')
            ->with([
                'user' => $this->user,
                'password' => $this->password,
                'url' => route('login'),
            ]);
    }
}
