Get file name from state update call

is there a way to get the origional file? the state object contains the random generated name
Forms\Components\FileUpload::make('file')
->label(__('labels.file'))
->directory('documents')
->afterStateUpdated(function ($state, Forms\Get $get) {
ray($get('file_name')); //null
ray($state);
})
->disk('local')
->storeFileNamesIn('file_name')
->required(fn(string $operation) => $operation === 'create')
->columnSpanFull(),
Forms\Components\FileUpload::make('file')
->label(__('labels.file'))
->directory('documents')
->afterStateUpdated(function ($state, Forms\Get $get) {
ray($get('file_name')); //null
ray($state);
})
->disk('local')
->storeFileNamesIn('file_name')
->required(fn(string $operation) => $operation === 'create')
->columnSpanFull(),
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?