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

@@ -77,12 +77,16 @@ class FacultyProfileController extends Controller
// Handle profile photo upload
if ($request->hasFile('profile_photo')) {
if ($profile->profile_photo_path && Storage::exists($profile->profile_photo_path)) {
Storage::delete($profile->profile_photo_path);
if ($profile->profile_photo_path && Storage::disk('public')->exists($profile->profile_photo_path)) {
Storage::disk('public')->delete($profile->profile_photo_path);
}
$validated['profile_photo_path'] = $request->file('profile_photo')
->store('public/profile_photos');
$path = $request->file('profile_photo')->store('profile_photos', 'public');
$validated['profile_photo_path'] = $path;
// Update user profile image as well
$user->profile_image = $path;
$user->save();
}
// Update profile with validated data