$this->saveUploadedFileUsing(static function (BaseFileUpload $component, TemporaryUploadedFile $file): ?string {
try {
if (!$file->exists()) {
return null;
}
} catch (UnableToCheckFileExistence $exception) {
return null;
}
// dispatch rest of logic in job
Job::dispatch($file, $component);
// Error: Serialization of 'Closure' is not allowed
$this->saveUploadedFileUsing(static function (BaseFileUpload $component, TemporaryUploadedFile $file): ?string {
try {
if (!$file->exists()) {
return null;
}
} catch (UnableToCheckFileExistence $exception) {
return null;
}
// dispatch rest of logic in job
Job::dispatch($file, $component);
// Error: Serialization of 'Closure' is not allowed