this is my controller (``` <?php
namespace App\Http\Controllers;
// use Exception;
use App\Models\User;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use GuzzleHttp\Promise\Create;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Laravel\Socialite\Facades\Socialite;
class SocialiteController extends Controller
{
/**
* Display a listing of the resource.
*/
public function redirect()
{
return Socialite::driver("google")->redirect();
}
/**
* Show the form for creating a new resource.
*/
public function callback()
{
$googleUser = Socialite::driver("google")->user();
$user = User::updateOrCreate(
['google_id' => $googleUser->id],
[
'name' => $googleUser->name,
'email' => $googleUser->email,
'password' => Str::password(12),
'email_verified_at' => now()
]
);
Auth::login($user);
return redirect(config("user.dashboard.index"). "/user/home");
} ```)