I have a StaffResource that has a Image field typed as SpatieMediaLibraryImageColumn
When editing the StaffResource, Image loads correctly
I also needed a custom Page where the staff can edit their own profile, which I used the following
public function mount(): void
{
$staff = Staff::find($id);
dd($staff->toArray()); // `image` has the value of [] here...
$this->form->fill($staff->toArray());
}
I tried looking into EditStaff.php but was not able to gain any insights.
How do I make the profile page load image like the EditStaff page? Problem seems to be that $staff->toArray() returns an empty Image
Package
filament/spatie-laravel-media-library-plugin
Package Version
3.0.38
Laravel Version
10.21.0
Livewire Version
3.0.1
PHP Version
8.1.20
Problem description
StaffResource
that has aImage
field typed asSpatieMediaLibraryImageColumn
StaffResource
,Image
loads correctlyI also needed a custom
Page
where the staff can edit their own profile, which I used the followingEditStaff.php
but was not able to gain any insights.EditStaff
page? Problem seems to be that$staff->toArray()
returns an emptyImage
Expected behavior
The
Image
field should show the currently saved image instead of having it blankSteps to reproduce
.env
/admin/test
and see the staff's name, but not the uploaded imageReproduction repository
https://github.com/bilogic/filament-spatie-upload-issue
Relevant log output
No response