Skip to content

Commit 2cc5b5d

Browse files
committed
Added ability to programmatically specify custom queue on the fileAdder
1 parent 6e743f8 commit 2cc5b5d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/MediaCollections/FileAdder.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class FileAdder
5050

5151
protected string $diskName = '';
5252

53+
protected ?string $onQueue = null;
54+
5355
protected ?int $fileSize = null;
5456

5557
protected string $conversionsDiskName = '';
@@ -178,6 +180,13 @@ public function storingConversionsOnDisk(string $diskName): self
178180
return $this;
179181
}
180182

183+
public function onQueue(?string $queue = null): self
184+
{
185+
$this->onQueue = $queue;
186+
187+
return $this;
188+
}
189+
181190
public function withManipulations(array $manipulations): self
182191
{
183192
$this->manipulations = $manipulations;
@@ -475,7 +484,7 @@ protected function processMediaItem(HasMedia $model, Media $media, self $fileAdd
475484
$job->onConnection($customConnection);
476485
}
477486

478-
if ($customQueue = config('media-library.queue_name')) {
487+
if ($customQueue = ($this->onQueue ?? config('media-library.queue_name'))) {
479488
$job->onQueue($customQueue);
480489
}
481490

0 commit comments

Comments
 (0)