Created
August 6, 2019 06:58
-
-
Save fhulufhelo/116f80e76830cf647159c06e3c8e5a91 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\WelcomeSeller; | |
use Illuminate\Support\Facades\Mail; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Http\Request; | |
class RegisterSeller 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 WelcomeSeller($user)); | |
// Login user | |
$credentials = $request->only('email', 'password'); | |
Auth::attempt($credentials); | |
// rediect user to dashbord | |
return redirect()->intended('dashboard.seller'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment