1 | <?php |
||
2 | |||
3 | namespace Ikechukwukalu\Clamavfileupload\Events; |
||
4 | |||
5 | use Ikechukwukalu\Clamavfileupload\Models\FileUpload as FileUploadModel; |
||
6 | use Illuminate\Broadcasting\Channel; |
||
7 | use Illuminate\Broadcasting\InteractsWithSockets; |
||
8 | use Illuminate\Broadcasting\PresenceChannel; |
||
9 | use Illuminate\Broadcasting\PrivateChannel; |
||
10 | use Illuminate\Contracts\Broadcasting\ShouldBroadcast; |
||
11 | use Illuminate\Database\Eloquent\Collection as EloquentCollection; |
||
12 | use Illuminate\Foundation\Events\Dispatchable; |
||
13 | use Illuminate\Queue\SerializesModels; |
||
14 | |||
15 | class SavedFilesIntoDB |
||
16 | { |
||
17 | use Dispatchable, InteractsWithSockets, SerializesModels; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
18 | |||
19 | public FileUploadModel|EloquentCollection $files; |
||
20 | public string $ref; |
||
21 | |||
22 | /** |
||
23 | * Create a new event instance. |
||
24 | * |
||
25 | * @param FileUploadModel|EloquentCollection $files |
||
26 | * @param string $ref |
||
27 | */ |
||
28 | public function __construct(FileUploadModel|EloquentCollection $files, string $ref) |
||
29 | { |
||
30 | $this->files = $files; |
||
31 | $this->ref = $ref; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Get the channels the event should broadcast on. |
||
36 | * |
||
37 | * @return array<int, \Illuminate\Broadcasting\Channel> |
||
38 | */ |
||
39 | public function broadcastOn(): array |
||
40 | { |
||
41 | return [ |
||
42 | new PrivateChannel('channel-name'), |
||
43 | ]; |
||
44 | } |
||
45 | } |
||
46 |