broadcast new files to the frontend after file was remotely uploaded

This commit is contained in:
Čarodej
2022-04-23 09:44:43 +02:00
parent 4b366747b6
commit 0a9740a363
14 changed files with 159 additions and 62 deletions

View File

@@ -33,8 +33,14 @@ class UploadFilesRemotelyForUploadRequestController
$request->merge(['parent_id' => $uploadRequest->id]);
}
// Execute job for get content from url and save
($this->getContentFromExternalSource)($request->all(), $uploadRequest->user);
// Get content from external sources
if (isBroadcasting()) {
($this->getContentFromExternalSource)
->onQueue()
->execute($request->all(), $uploadRequest->user);
} else {
($this->getContentFromExternalSource)($request->all(), $uploadRequest->user);
}
// Set timestamp for auto filling
cache()->set("auto-filling.$uploadRequest->id", now()->toString());