Skip to content

feat(profile): allow clearing and removing avatar photo - #338

Merged
trtajim merged 1 commit into
mainfrom
feat/clear-profile-avatar
Sep 11, 2026
Merged

feat(profile): allow clearing and removing avatar photo#338
trtajim merged 1 commit into
mainfrom
feat/clear-profile-avatar

Conversation

@trtajim

@trtajim trtajim commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

This PR adds support for users to clear or remove their profile picture on the Profile page.

Summary of Changes:

  • Frontend (Profile.vue): Added a clean 'Remove Photo' / 'Clear Selected' button and instant preview.
  • Backend (ProfileController.php & UpdateProfileRequest.php): Added validation and handling for the clear_image flag to remove the avatar file from storage and set image_path to null in the database.

Summary by CodeRabbit

  • New Features
    • Added live previews when selecting a new profile photo.
    • Added options to remove an existing photo or clear a newly selected photo before saving.
    • Added a notice indicating when the current photo will be removed upon saving.
    • Profile photo removal is now saved correctly, including deleting the stored image and clearing the profile image reference.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: f05c582d-fea9-48e7-bd1b-aef7614a9f3f

📥 Commits

Reviewing files that changed from the base of the PR and between 843a5f5 and 8b5c1f3.

📒 Files selected for processing (3)
  • app/Http/Controllers/ProfileController.php
  • app/Http/Requests/Profile/UpdateProfileRequest.php
  • resources/js/pages/Profile.vue

📝 Walkthrough

Walkthrough

Profile image management now supports live previews, clearing selected or existing images, and server-side removal. The profile form sends clear_image, and the controller deletes the stored image when requested.

Changes

Profile image removal

Layer / File(s) Summary
Clear image request processing
app/Http/Requests/Profile/UpdateProfileRequest.php, app/Http/Controllers/ProfileController.php
The update request accepts an optional clear_image boolean. The controller deletes the stored image and sets image_path to null when the flag is enabled.
Profile avatar interaction
resources/js/pages/Profile.vue
The profile page supports avatar previews, removal controls, file-input reset, conditional avatar rendering, and removal-state helper text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/clear-profile-avatar

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@trtajim
trtajim merged commit 97fd6f1 into main Sep 11, 2026
5 of 6 checks passed
@trtajim
trtajim deleted the feat/clear-profile-avatar branch September 11, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant