Skip to content

Instantly share code, notes, and snippets.

@fhulufhelo
Created August 6, 2019 06:58
Show Gist options
  • Save fhulufhelo/116f80e76830cf647159c06e3c8e5a91 to your computer and use it in GitHub Desktop.
Save fhulufhelo/116f80e76830cf647159c06e3c8e5a91 to your computer and use it in GitHub Desktop.
<?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