© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
Gunnolfson

Change resource ID for FileUpload form field

Hi

I did some few things to have a ULID encoded as
binary(16)
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)
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
public function retrieveById($identifier): Model|Builder|Authenticatable|null
{
    $identifier = Ulid::fromString($identifier)->toBinary();
    $model = $this->createModel();

    return $this->newModelQuery($model)
        ->where($model->getAuthIdentifierName(), $identifier)
        ->first();
}
public function retrieveById($identifier): Model|Builder|Authenticatable|null
{
    $identifier = Ulid::fromString($identifier)->toBinary();
    $model = $this->createModel();

    return $this->newModelQuery($model)
        ->where($model->getAuthIdentifierName(), $identifier)
        ->first();
}

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?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

change fileupload field preview url
FilamentFFilament / ❓┊help
2y ago
FileUpload Form Field gives unexpected error.
FilamentFFilament / ❓┊help
2y ago
Custom form field inside resource
FilamentFFilament / ❓┊help
3y ago
Fileupload field
FilamentFFilament / ❓┊help
2y ago