PHP code example of zipzoft / laravel-message-transporter
1. Go to this page and download the library: Download zipzoft/laravel-message-transporter 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/ */
zipzoft / laravel-message-transporter example snippets
namespace App\Events;
use App\User;
use Zipzoft\MessageTransporter\ShouldBroadcastAppServices;
use Zipzoft\MessageTransporter\ShouldBroadcastAppServicesNow;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\PrivateChannel;
class UserCreated implements ShouldBroadcastAppServices
{
// ....
public $user;
public function __construct(User $user)
{
$this->user = $user;
}
public function broadcastOn()
{
return [
new Channel("app"),
new PrivateChannel("call-center"),
];
}
// Supported method
// broadcastWith, broadcastWhen, broadcastAs
}
use Zipzoft\MessageTransporter\ShouldBroadcastAppServicesNow;