Skip to content

Commit a99d272

Browse files
committed
add events
1 parent 3d776c1 commit a99d272

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\ChildProcess;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7+
use Illuminate\Foundation\Events\Dispatchable;
8+
use Illuminate\Queue\SerializesModels;
9+
10+
class ErrorReceived implements ShouldBroadcast
11+
{
12+
use Dispatchable, SerializesModels;
13+
14+
public function __construct(public string $alias, public mixed $data) {}
15+
16+
public function broadcastOn()
17+
{
18+
return [
19+
new Channel('nativephp'),
20+
];
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\ChildProcess;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7+
use Illuminate\Foundation\Events\Dispatchable;
8+
use Illuminate\Queue\SerializesModels;
9+
10+
class MessageReceived implements ShouldBroadcast
11+
{
12+
use Dispatchable, SerializesModels;
13+
14+
public function __construct(public string $alias, public mixed $data) {}
15+
16+
public function broadcastOn()
17+
{
18+
return [
19+
new Channel('nativephp'),
20+
];
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\ChildProcess;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
7+
use Illuminate\Foundation\Events\Dispatchable;
8+
use Illuminate\Queue\SerializesModels;
9+
10+
class ProcessExited implements ShouldBroadcast
11+
{
12+
use Dispatchable, SerializesModels;
13+
14+
public function __construct(public string $alias, public int $code) {}
15+
16+
public function broadcastOn()
17+
{
18+
return [
19+
new Channel('nativephp'),
20+
];
21+
}
22+
}

0 commit comments

Comments
 (0)