redirect(); } public function handleGoogleCallback() { try { $googleUser = Socialite::driver('google')->user(); // Check if user already exists $user = User::where('email', $googleUser->getEmail())->first(); if (!$user) { // Create a new user $user = User::create([ 'name' => $googleUser->getName(), 'email' => $googleUser->getEmail(), 'google_id' => $googleUser->getId(), 'password' => bcrypt('google123'), // dummy password ]); } Auth::login($user); return redirect()->to('/home'); } catch (\Exception $e) { return redirect()->to('/login')->with('error', 'Failed to login using Google.'); } } } redirect(); } public function handleGoogleCallback() { try { $googleUser = Socialite::driver('google')->user(); // Check if user already exists $user = User::where('email', $googleUser->getEmail())->first(); if (!$user) { // Create a new user $user = User::create([ 'name' => $googleUser->getName(), 'email' => $googleUser->getEmail(), 'google_id' => $googleUser->getId(), 'password' => bcrypt('google123'), // dummy password ]); } Auth::login($user); return redirect()->to('/home'); } catch (\Exception $e) { return redirect()->to('/login')->with('error', 'Failed to login using Google.'); } } } redirect(); } public function handleGoogleCallback() { try { $googleUser = Socialite::driver('google')->user(); // Check if user already exists $user = User::where('email', $googleUser->getEmail())->first(); if (!$user) { // Create a new user $user = User::create([ 'name' => $googleUser->getName(), 'email' => $googleUser->getEmail(), 'google_id' => $googleUser->getId(), 'password' => bcrypt('google123'), // dummy password ]); } Auth::login($user); return redirect()->to('/home'); } catch (\Exception $e) { return redirect()->to('/login')->with('error', 'Failed to login using Google.'); } } } redirect(); } public function handleGoogleCallback() { try { $googleUser = Socialite::driver('google')->user(); // Check if user already exists $user = User::where('email', $googleUser->getEmail())->first(); if (!$user) { // Create a new user $user = User::create([ 'name' => $googleUser->getName(), 'email' => $googleUser->getEmail(), 'google_id' => $googleUser->getId(), 'password' => bcrypt('google123'), // dummy password ]); } Auth::login($user); return redirect()->to('/home'); } catch (\Exception $e) { return redirect()->to('/login')->with('error', 'Failed to login using Google.'); } } } redirect(); } public function handleGoogleCallback() { try { $googleUser = Socialite::driver('google')->user(); // Check if user already exists $user = User::where('email', $googleUser->getEmail())->first(); if (!$user) { // Create a new user $user = User::create([ 'name' => $googleUser->getName(), 'email' => $googleUser->getEmail(), 'google_id' => $googleUser->getId(), 'password' => bcrypt('google123'), // dummy password ]); } Auth::login($user); return redirect()->to('/home'); } catch (\Exception $e) { return redirect()->to('/login')->with('error', 'Failed to login using Google.'); } } } Target class [App\Http\Controllers\SocialController] does not exist.