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