1. Go to this page and download the library: Download condoedge/communications 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/ */
condoedge / communications example snippets
class RandomTriggerer implements CommunicableEvent
{
use Dispatchable, InteractsWithSockets, SerializesModels;
protected $event;
protected $teamsIds;
public function __construct($event)
{
$this->event = $event;
}
function getParams(): array
{
return [
'event' => $this->event,
];
}
// If you don't set communicables, the communication won't be sent
function getCommunicables(): array|Collection
{
return CommunicableRandom::where('event_id', $this->event->id)->get();
}
static function getName(): string
{
return __('communications.a-random-triggerer');
}
}