© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
1 reply
DanielvdSpoel

Get file name from state update call

is there a way to get the origional file? the state object contains the random generated name

                Forms\Components\FileUpload::make('file')
                    ->label(__('labels.file'))
                    ->directory('documents')
                    ->afterStateUpdated(function ($state, Forms\Get $get) {
                        ray($get('file_name')); //null
                        ray($state);
                    })
                    ->disk('local')
                    ->storeFileNamesIn('file_name')
                    ->required(fn(string $operation) => $operation === 'create')
                    ->columnSpanFull(),
                Forms\Components\FileUpload::make('file')
                    ->label(__('labels.file'))
                    ->directory('documents')
                    ->afterStateUpdated(function ($state, Forms\Get $get) {
                        ray($get('file_name')); //null
                        ray($state);
                    })
                    ->disk('local')
                    ->storeFileNamesIn('file_name')
                    ->required(fn(string $operation) => $operation === 'create')
                    ->columnSpanFull(),
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

Get file name from media table
FilamentFFilament / ❓┊help
3y ago
Update field state from alpine
FilamentFFilament / ❓┊help
3y ago
How to get File name SpatieMediaLibraryFileUpload
FilamentFFilament / ❓┊help
3y ago
Update Form FIELD state from JS
FilamentFFilament / ❓┊help
2y ago