1. Go to this page and download the library: Download iliakologrivov/centrifuge library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use IliaKologrivov\Centrifuge\Channels\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class event implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public function broadcastAs()
{
return 'event-name';
}
/**
* Get the channels the event should broadcast on.
*
* @return \Centrifuge\Channels\Channel|array
*/
public function broadcastOn()
{
return new Channel('example-channel');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.