F
Filamentβ€’2w ago
BKF Dev

Custom FileUpload action

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']); }),
2 Replies
Dimitar Papazov DEV
Dimitar Papazov DEVβ€’2w ago
have you tried?
FileUpload::make('file')
->saveUploadedFileUsing(function ($record, $file) {
// todo
})
FileUpload::make('file')
->saveUploadedFileUsing(function ($record, $file) {
// todo
})
BKF Dev
BKF Devβ€’2w ago
GREAT ! Thanks dear @Dimitar Papazov DEV πŸ™‚
Want results from more Discord servers?
Add your server