How to display a file uploaded in a previous step in a Filament wizard form (before submission)?
I’m using a multi-step (wizard) form in Laravel + Filament.
In the first step, the user uploads a file using the FileUpload component.
Is it possible to access or display that uploaded file in a later step (e.g., a Review step), even before the form is submitted?
I’d like to show a preview or a link to the file that was attached in the earlier step.
7 Replies
did you try
$get('file')
would it be something like that? @Lara Zeus

can you share some code so we can understand more what are you trying to do.
in the final step of the wizard how you want to display the uploaded file?
this is my first step @Lara Zeus

and I would like to display a preview or something like that in my last step, which is a data review step

but what comes from $document[0] is something like an id
maybe what I'm writing might seem a little confusing, I'm using the help of a translator hehehe
I got what I wanted. Instead of accessing $document[0], I retrieved the first value of the array regardless of its key. Since only one document is uploaded, that’s enough.
If you have any suggestions, I'd be happy to hear them. :))
This a correct approach. FileUpload uses UUIDs for the array keys. So, collect is fine or you could use the Arr class with Arr::first(). it’s effectively the same thing.