Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| TestEvent | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| broadcastOn | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| broadcastAs | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Events; |
| 4 | |
| 5 | use Illuminate\Broadcasting\Channel; |
| 6 | use Illuminate\Broadcasting\InteractsWithSockets; |
| 7 | use Illuminate\Contracts\Broadcasting\ShouldBroadcast; |
| 8 | use Illuminate\Foundation\Events\Dispatchable; |
| 9 | use Illuminate\Queue\SerializesModels; |
| 10 | |
| 11 | class TestEvent implements ShouldBroadcast |
| 12 | { |
| 13 | use Dispatchable, InteractsWithSockets, SerializesModels; |
| 14 | |
| 15 | public function __construct(public $message) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | public function broadcastOn() |
| 20 | { |
| 21 | return new Channel('test-channel'); // public channel |
| 22 | } |
| 23 | |
| 24 | public function broadcastAs(): string |
| 25 | { |
| 26 | return 'test-event'; |
| 27 | } |
| 28 | } |