#Custom FileUpload action

3 messages · Page 1 of 1 (latest)

sour sand
#

Hello everyone,
I have a RelationManager form which has a FileUpload input, I want to get file information same as in liverwire, so how can I do that ?
public function form(Form $form): Form { return $form ->schema([ FileUpload::make('file') ->label(__('File')) ->columnSpanFull() ->required(), TextInput::make('title') ->label(__('Title')) ->columnSpanFull(), Textarea::make('description') ->label(__('Descritption')) ->columnSpanFull(), ]); }
.....
` Tables\Actions\CreateAction::make()
->slideOver()
->action(function ($data) {
// how to access to file name, ext, ....
dd($data['file']);

                }),`
dense gobletBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

last stirrup
#

have you tried?


FileUpload::make('file')
   ->saveUploadedFileUsing(function ($record, $file) {
                                         // todo
     })