Updated Google Avatar, Admin Features, All Pages with small changes, Filters in Publications Page

This commit is contained in:
tanmaychinchore
2025-12-11 18:01:16 +05:30
parent f81f73d614
commit 54725c2a05
12 changed files with 236 additions and 63 deletions

View File

@@ -43,9 +43,21 @@ class GoogleController extends Controller
[
'name' => $googleUser->getName() ?: $email,
'password' => bcrypt(Str::random(16)), // Generate a random password
'profile_image' => $googleUser->getAvatar(),
]
);
// Update profile image if it changed or wasn't set (for existing users logging in)
if (!$user->profile_image) {
$user->update(['profile_image' => $googleUser->getAvatar()]);
}
// Sync to FacultyProfile
$profile = \App\Models\FacultyProfile::firstOrCreate(['user_id' => $user->id]);
if (!$profile->profile_photo_path) {
$profile->update(['profile_photo_path' => $googleUser->getAvatar()]);
}
Auth::login($user);
return redirect()->route('dashboard');