spatie media library file upload load file

I have a custom header with an image, and when the image is clicked, a Header action was dispatched. How to show the current avatar image in the field?
protected function getHeaderActions(): array
{
return [
Action::make('changeAvatar')
->label('Canvia foto d\'alumne')
->modalWidth('sm')
->form([
SpatieMediaLibraryFileUpload::make('avatar')
->alignCenter()
->label('')
->avatar()
->collection('avatar')
->circleCropper()
->imageEditor()
->acceptedFileTypes([
'image/png','image/jpg','image/jpeg'
]),
])
];
}
protected function getHeaderActions(): array
{
return [
Action::make('changeAvatar')
->label('Canvia foto d\'alumne')
->modalWidth('sm')
->form([
SpatieMediaLibraryFileUpload::make('avatar')
->alignCenter()
->label('')
->avatar()
->collection('avatar')
->circleCropper()
->imageEditor()
->acceptedFileTypes([
'image/png','image/jpg','image/jpeg'
]),
])
];
}
No description
1 Reply
tesse05
tesse05OP7mo ago
up
Want results from more Discord servers?
Add your server