diff --git a/src/HasProfilePhoto.php b/src/HasProfilePhoto.php index 08299e760..f0aec9151 100644 --- a/src/HasProfilePhoto.php +++ b/src/HasProfilePhoto.php @@ -13,14 +13,15 @@ trait HasProfilePhoto * Update the user's profile photo. * * @param \Illuminate\Http\UploadedFile $photo + * @param string $storagePath * @return void */ - public function updateProfilePhoto(UploadedFile $photo) + public function updateProfilePhoto(UploadedFile $photo, $storagePath = 'profile-photos') { - tap($this->profile_photo_path, function ($previous) use ($photo) { + tap($this->profile_photo_path, function ($previous) use ($photo, $storagePath) { $this->forceFill([ 'profile_photo_path' => $photo->storePublicly( - 'profile-photos', ['disk' => $this->profilePhotoDisk()] + $storagePath, ['disk' => $this->profilePhotoDisk()] ), ])->save();