'pass data to welcome message

my register has a welcome message (email), it generates a random number

protected function create(array $data)
{
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        't_matricula' => $data['t_matricula'],
        'number' => rand(100, 9200),
        'matricula' => $data['matricula'],
        'password' => Hash::make($data['password']),
    ]);

    Mail::to($user->email)->send(new WelcomeMail($user));
    
    return $user;
}

the problem is that no welcome message arrives



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source