1 | <?php |
||
2 | |||
3 | namespace FaithGen\Sermons\Jobs; |
||
4 | |||
5 | use FaithGen\SDK\Traits\ProcessesImages; |
||
6 | use FaithGen\Sermons\Models\Sermon; |
||
7 | use Illuminate\Bus\Queueable; |
||
8 | use Illuminate\Contracts\Queue\ShouldQueue; |
||
9 | use Illuminate\Foundation\Bus\Dispatchable; |
||
10 | use Illuminate\Queue\InteractsWithQueue; |
||
11 | use Illuminate\Queue\SerializesModels; |
||
12 | use Intervention\Image\ImageManager; |
||
13 | |||
14 | class ProcessImage implements ShouldQueue |
||
15 | { |
||
16 | use Dispatchable, |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
17 | InteractsWithQueue, |
||
18 | Queueable, |
||
19 | SerializesModels, |
||
20 | ProcessesImages; |
||
21 | |||
22 | public bool $deleteWhenMissingModels = true; |
||
23 | protected Sermon $sermon; |
||
24 | |||
25 | /** |
||
26 | * Create a new job instance. |
||
27 | * |
||
28 | * @param Sermon $sermon |
||
29 | */ |
||
30 | public function __construct(Sermon $sermon) |
||
31 | { |
||
32 | $this->sermon = $sermon; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Execute the job. |
||
37 | * |
||
38 | * @param ImageManager $imageManager |
||
39 | * |
||
40 | * @return void |
||
41 | */ |
||
42 | public function handle(ImageManager $imageManager) |
||
43 | { |
||
44 | $this->processImage($imageManager, $this->sermon); |
||
45 | } |
||
46 | } |
||
47 |