In this episode, we're diving into adding a profile photo upload field to our app. We'll walk through exactly where to add this field within the existing profile information form—specifically inside the update-profile-information-form.blade.php
in a Laravel Breeze-powered project. Even if you're new to Breeze or using the Vault stack, everything here will still make sense.
We build out the profile photo upload field as a Livewire component for flexibility, register it within our form, and get it ready for uploads. Using Livewire's WithFileUploads
trait, we let users pick an image and show a preview right away—so you can see your new avatar before saving. There's a bit of Tailwind styling here too, making sure the upload button feels user-friendly and the photo preview looks clean.
One cool twist: we make the component reusable for more than just users! By making sure the upload field accepts any model, you can use it for teams or other models just by passing them in. By the end, you'll have a polished photo upload field that shows the current profile photo, lets users select a new one with an instant preview, and is easy to reuse elsewhere in your app.