|
@@ -15,14 +15,6 @@ class GenerateFilesPack implements ShouldQueue
|
|
|
{
|
|
{
|
|
|
use Queueable;
|
|
use Queueable;
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * Execute the job.
|
|
|
|
|
- */
|
|
|
|
|
- public function handle(): void
|
|
|
|
|
- {
|
|
|
|
|
- //
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Create a new job instance.
|
|
* Create a new job instance.
|
|
|
*/
|
|
*/
|
|
@@ -32,10 +24,16 @@ class GenerateFilesPack implements ShouldQueue
|
|
|
private readonly int $userId,
|
|
private readonly int $userId,
|
|
|
private readonly string $name = 'files',
|
|
private readonly string $name = 'files',
|
|
|
)
|
|
)
|
|
|
|
|
+ {}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Execute the job.
|
|
|
|
|
+ */
|
|
|
|
|
+ public function handle(): void
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- $file = (new GenerateDocumentsService())->generateFilePack($this->collection, $this->userId, $name);
|
|
|
|
|
- $model->documents()->attach($file->id);
|
|
|
|
|
|
|
+ $file = (new GenerateDocumentsService())->generateFilePack($this->collection, $this->userId, $this->name);
|
|
|
|
|
+ $this->model->documents()->attach($file->id);
|
|
|
Log::info('Generate file pack finished!');
|
|
Log::info('Generate file pack finished!');
|
|
|
event(new SendWebSocketMessageEvent('Пакет файлов готов!', $this->userId, ['success' => true, 'link' => $file->link]));
|
|
event(new SendWebSocketMessageEvent('Пакет файлов готов!', $this->userId, ['success' => true, 'link' => $file->link]));
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|