title: Laravel: send email on registration
body: <p>I want to be able to send emails through the registration of my system. I have set up all the mailtrap information and included all my key imports. However im not sure if the actual way of sending the email is correct. I keep getting error: undefined variable email, see the code below:</p>
  
  <pre><code>    protected function create(array $data)
  {
  
      return User::create([
          'name' =&gt; $data['name'],
          'email' =&gt; $data['email'],
          'password' =&gt; Hash::make($data['password']),
      ]);
      Mail::to($data['email'])-&gt;send(new WelcomeMail());
  }
  }
  </code></pre>
  
  <p>I have imported welcomemail and the facades import so everything is good to go, however i am unable to send the email as of now.</p>