-
-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the
assets:generate-presets
command queue friendly (#3490)
- Loading branch information
1 parent
a0c1a6f
commit d630244
Showing
2 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Statamic\Jobs; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Statamic\Contracts\Assets\Asset; | ||
use Statamic\Imaging\PresetGenerator; | ||
|
||
class GeneratePresetImageManipulation implements ShouldQueue | ||
{ | ||
use Dispatchable, InteractsWithQueue, Queueable; | ||
|
||
public $asset; | ||
public $preset; | ||
|
||
public function __construct(Asset $asset, $preset) | ||
{ | ||
$this->asset = $asset; | ||
$this->preset = $preset; | ||
} | ||
|
||
public function handle(PresetGenerator $generator) | ||
{ | ||
$generator->generate($this->asset, $this->preset); | ||
} | ||
} |