Last active
August 6, 2019 07:02
-
-
Save fhulufhelo/f1c7db144b4375f4192922c3ec84b41f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\RegisterUser; | |
use App\Mail\WelcomeBuyer; | |
use Illuminate\Support\Facades\Mail; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Http\Request; | |
class RegisterBuyer extends Registering | |
{ | |
public function handle(Request $request) | |
{ | |
$user = $this->create($request->all()); | |
// Send welcome email to newly created seller user | |
Mail::to($user)->send(new WelcomeBuyer($user)); | |
// Login user | |
$credentials = $request->only('email', 'password'); | |
Auth::attempt($credentials); | |
// rediect user to dashbord | |
return redirect()->intended('dashboard.buyer'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment