Updated Google Avatar, Admin Features, All Pages with small changes, Filters in Publications Page
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user