Adding a Welcome Mail

This commit is contained in:
2018-09-14 17:00:28 -03:00
parent 882609fed0
commit aa46622a14
3 changed files with 55 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Auth;
use App\User;
use App\Mail\Welcome;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
@@ -63,10 +64,14 @@ class RegisterController extends Controller
*/
protected function create(array $data)
{
return User::create([
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
\Mail::to($user)->send(new Welcome($user));
return $user;
}
}