Some checks failed
continuous-integration/drone/push Build is failing
- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class RealTimeNotification implements ShouldBroadcast
|
|
{
|
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
|
|
/**
|
|
* Create a new event instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
//
|
|
}
|
|
|
|
public function broadcastWith()
|
|
{
|
|
return [
|
|
'message' => 'mio test'
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Get the channels the event should broadcast on.
|
|
*
|
|
* @return \Illuminate\Broadcasting\Channel|array
|
|
*/
|
|
public function broadcastOn()
|
|
{
|
|
// return new PrivateChannel('channel-name');
|
|
return new channel('communications');
|
|
}
|
|
|
|
/**
|
|
* The event's broadcast name.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function broadcastAs()
|
|
{
|
|
return 'global.message';
|
|
}
|
|
}
|