Skip to content

Commit 44ff8ca

Browse files
committed
add option to specify queue name
1 parent 6c5bc7d commit 44ff8ca

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22

33
All Notable changes to `laravel-medialibrary` will be documented in this file
44

5+
##1.0.1
6+
- Added option to specify the name of the queue that should be used to create image manipulations
7+
58
##1.0.0
69
- initial release

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,18 @@ return [
7474
* See the README of the package for an example.
7575
*/
7676
'globalImageProfiles' => [],
77+
78+
/*
79+
* The medialibrary will used this queue to generate derived images.
80+
* Leave empty to use the default queue.
81+
*/
82+
83+
'queueName' => 'media_queue',
7784
];
7885
```
7986

87+
If you are planning on working with the image manipulations you should configure a queue on your service with the name specified in the config file.
88+
8089
## Basic usage
8190

8291

src/ImageManipulators/GlideImageManipulator.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private function createProfileImages(Media $media, $originalFile, $originalPath)
8484
'conversionParameters' => $imageConversionParameters,
8585
'outputFile' => $outputFile,
8686
],
87-
'media_queue'
87+
$this->getQueueName()
8888
);
8989

9090
return;
@@ -175,4 +175,17 @@ private function getModelImageProfiles($className)
175175

176176
return $model->imageProfiles;
177177
}
178+
179+
/**
180+
* @return string
181+
*/
182+
private function getQueueName()
183+
{
184+
if (config('laravel-medialibrary.queueName') == '')
185+
{
186+
return null;
187+
}
188+
189+
return config('laravel-medialibrary.queueName');
190+
}
178191
}

src/ToPublish/config/laravel-medialibrary.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,11 @@
2525
* See the README of the package for an example.
2626
*/
2727
'globalImageProfiles' => [],
28+
29+
/*
30+
* The medialibrary will used this queue to generate derived images.
31+
* Leave empty to use the default queue.
32+
*/
33+
34+
'queueName' => 'media_queue',
2835
];

0 commit comments

Comments
 (0)