need to tap into file upload save process
I have this action in my page class:
I want to be able to customize the data before saving it and I can't seem to tap into that. I've tried using the
->model(...)
and ->statePath(...)
methods. Also tried looking through the source code for the BaseFileUpload class and didn't see anything that looked like it might apply. I'm used to seeing something like mutateFormDataBeforeSave
.
The file is being saved to livewire-tmp, but nothing else happens and no error, which is strange because I'm not sure how it would be able to save to the database since I have other required fields it knows nothing about, which is why I need to customize the save process.3 Replies
Bump, any ideas here?
You’re trying to hook in too late. You need to override the FileUpload component itself. Maybe some guidance at https://github.com/awcodes/filament-curator/blob/3.x/src/Components/Forms/Uploader.php
GitHub
filament-curator/src/Components/Forms/Uploader.php at 3.x · awcodes...
A media picker plugin for Filament Panels. Contribute to awcodes/filament-curator development by creating an account on GitHub.
Ok thanks, I’ll check it ou
After reviewing your code, I saw one place where you had done something like the below, so I tried it, and it ended up working for my use case. Leaving this here for anyone else who may run into this: