Is there a field lifecycle for delete in FileUpload?

currently my fileupload is set to upload real time and creates a Model record using a model called "File", the ->afterStateUpdated is working for doing it. Now my question is what the code for deleting a file?
FileUpload::make('files'
->reactive()
->required()
->multiple()
->afterStateUpdated(function(FileUpload $component, Get $get, Set $set, $state){
$component->saveUploadedFiles();
$files = \Arr::flatten($component->getState());

foreach($files as $singleFile){
$fileRecord = File::create([

]);
}

}),
FileUpload::make('files'
->reactive()
->required()
->multiple()
->afterStateUpdated(function(FileUpload $component, Get $get, Set $set, $state){
$component->saveUploadedFiles();
$files = \Arr::flatten($component->getState());

foreach($files as $singleFile){
$fileRecord = File::create([

]);
}

}),
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server