Fileupload in Single record editing with custom page

im trying to follow this instruction online https://laraveldaily.com/post/filament-edit-only-single-record-custom-page, but the example was only for text input.
I try something like fileupload for my case, since the mountng and saving data work around array, i have a problem for fileupload (filepond).

instead of saving the filename, it save a weird json (logs on the bottom)
and the tmp file are not moved to the storage disk, is there a way to make fileupload in my custom page works like in resource page ?

https://pastebin.com/YypB3kbd (the code)

[2025-01-29 18:45:27] local.INFO: EditSchool mount(): School data loaded {"school_id":7527} 
[2025-01-29 18:46:09] local.INFO: EditSchool save(): Form data received {"data":{"id":7527,"name":"Drake Mathews","head_master":"Dorothy Munoz","head_master_photo":{"8d3531b5-084c-4110-8b03-f340ef3ae6ac":{"Livewire\\Features\\SupportFileUploads\\TemporaryUploadedFile":"/private/var/folders/0_/q6vx8bs94rz2gsmpn015m9x80000gn/T/phpuibqjc95utj31VnBah3"}},"accompanying_teacher":"Burris and James Trading","accompanying_teacher_photo":{"c6f21f1e-6036-4054-9041-db098ff6f6e6":{"Livewire\\Features\\SupportFileUploads\\TemporaryUploadedFile":"/private/var/folders/0_/q6vx8bs94rz2gsmpn015m9x80000gn/T/phphm8m9ivisdlr9w3Tqru"}},"address":"Cum odit ex omnis su","phone_number":"1901-5646-608","email":"tyjejyvemi@mailinator.com","contingent_leader":"Trevor Berger","contingent_leader_photo":{"6be73be6-3abf-45d7-a3cd-ea51dc73e836":{"Livewire\\Features\\SupportFileUploads\\TemporaryUploadedFile":"/private/var/folders/0_/q6vx8bs94rz2gsmpn015m9x80000gn/T/php06duca0965ro3kBNg5R"}},"created_at":"2025-01-29T10:54:31.000000Z","updated_at":"2025-01-29T18:27:34.000000Z","event_id":1}} 
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Solution
Thanks for all the help, i had to manually mutate the file before storing in db, so it will take the actual file path

    public function save(): void
    {
        // Get the form data
        $data = $this->form->getState();

        // Process file upload fields
        foreach (['head_master_photo', 'accompanying_teacher_photo', 'contingent_leader_photo'] as $field) {
            if (isset($data[$field]) && is_array($data[$field])) {
                // Extract the file path from the nested structure
                $filePath = array_values($data[$field])[0];
                $data[$field] = $filePath; // Update the data with the file path only
            }
        }

        // Update the school record with the processed data
        $this->school->update($data);

        Notification::make()
            ->success()
            ->title(__('filament-panels::resources/pages/edit-record.notifications.saved.title'))
            ->send();
    }
Was this page helpful?