© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•9mo ago•
1 reply
Azorky

Fileupload order not correct

I noticed that when uploading new files, they are appended and not added to the state array in the correct order.
I'm currently on the edit page and the 2 media items you see are already saved in the database.
When I add a new file in the middle and dump the state in ->afterStateUpdated() the order is already incorrect. The new item is not in the middle, but at the end of the array.
Forms\Components\FileUpload::make('media')
                                        ->label(__('resources/todos.media'))
                                        ->multiple()
                                        ->reorderable()
                                        ->appendFiles()
                                        ->directory('proposal-option')
                                        ->disk('s3_public')
                                        ->downloadable()
                                        ->openable()
                                        ->afterStateUpdated(fn ($state) => dd($state))
                                        ->dehydrateStateUsing(fn ($state) => dd($state))
                                        ->beforeStateDehydrated(fn ($state) => dd($state))
                                        ->reorderUploadedFilesUsing(fn ($state) => dd($state)),
Forms\Components\FileUpload::make('media')
                                        ->label(__('resources/todos.media'))
                                        ->multiple()
                                        ->reorderable()
                                        ->appendFiles()
                                        ->directory('proposal-option')
                                        ->disk('s3_public')
                                        ->downloadable()
                                        ->openable()
                                        ->afterStateUpdated(fn ($state) => dd($state))
                                        ->dehydrateStateUsing(fn ($state) => dd($state))
                                        ->beforeStateDehydrated(fn ($state) => dd($state))
                                        ->reorderUploadedFilesUsing(fn ($state) => dd($state)),


I tried other functions as well, but in each of them the order is incorrect.
image.png
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

FileUpload display order change
FilamentFFilament / ❓┊help
3y ago
fileupload not working
FilamentFFilament / ❓┊help
2y ago
FileUpload required not working
FilamentFFilament / ❓┊help
9mo ago
FileUpload validation not working
FilamentFFilament / ❓┊help
15mo ago