Created
July 17, 2023 14:48
-
-
Save ryanKinoti/46acb572ad4f0f2a48b8437e51f424b6 to your computer and use it in GitHub Desktop.
document/image saving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if there is already a profile picture stored | |
if ($finduser->profile_picture) { | |
// Delete the existing profile picture file | |
Storage::delete($finduser->profile_picture); | |
} | |
//procedure for saving profile pictures | |
$avatarPath = 'public/avatars/employers/' . $user->id . '.jpg'; | |
$avatarContents = file_get_contents($user->getAvatar()); | |
Storage::put($avatarPath, $avatarContents); | |
$finduser->profile_picture = $avatarPath; | |
$finduser->google_token = $user->token; | |
$finduser->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment