How can the FileUpload field in Laravel Filament directory be changed dynamically?

I have a form with a file upload. When i upload the file, it saves into my desired public/uploads/documents location. However, i want every user should save it's files public/uploads/documents/userfolder based on user foldername on my client's details table. I am using Relation manager to save client's details and uploaded files. How do i achieve this?
FileUpload::make('documents')->disk('public')->directory('uploads/documents/'.$foldername)
FileUpload::make('documents')->disk('public')->directory('uploads/documents/'.$foldername)
I want to get the $foldername from the related Parent model in the table.
1 Reply
Want results from more Discord servers?
Add your server