Change resource ID for FileUpload form field
Hi
I did some few things to have a ULID encoded as
binary(16)
(needed as the Backoffice would be made from Laravel Filament, because that's the best option I know, but the project isn't a Laravel project, and that's why it is not a char(26)
as Laravel handle by default)
Thing is I thus need to change things like user provider, resolve router binding etc to use a decoder on the ulid value (the value stored in DB is a binary value, the one managed by Laravel is a string, thanks to casting).
Here's what it looks like
However, when I come on an edit page for resource with a FileUpload field, I get a popup window with 404 😐 Is there anything I can do to debug it and fix it?6 Replies
Any idea? 😅
What is triggering the 404? Don’t understand what a file upload would have to do with authentication?
Same, I don't understand how the identifier of the resource is related to the file upload and I don't really know how to look for (in the file upload file I guess, but didn't figure out what was going on)
The 404 is trigerred right on the page load: it loads, I see the form, and a 404 popup opens immediatly.
Not sure it helps you 😅
Is the file upload using a relationship to the user, like an avatar or something.?
It does not, it only stores the path on a property like
varchar(255) - avatar
If this can help you, this is the repo: https://github.com/AlexandreGerault/mei-laravel (and the school resource for example, using the FileUpload input https://github.com/AlexandreGerault/mei-laravel/blob/refactor/ulid-primary-keys/src/Admin/Resources/SchoolResource.php#L75)
I wonder if there's any uuid package to make optimised uuid an ease to use, and also compatible with FilamentFilament works fine with uuid and ulid. It has to be something to do with the binary. Sorry i don’t have any experience with that and can’t help more.