Server IP : 66.29.132.124 / Your IP : 13.59.5.179 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/book24.ng/app/Events/ |
Upload File : |
<?php namespace App\Events; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Auth; class PusherNotificationPrivateEvent implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $message; public $avatar; public $link; public $idNotification; public $userId; public function __construct($idNotification, $data, $user) { if($user->avatar_url){ $avatar = '<img class="image-responsive" src="'.$user->avatar_url.'" alt="'.$user->getDisplayName().'">'; }else{ $avatar = '<span class="avatar-text">'.$user->getFirstCharacterDisplayName().'</span>'; } $this->avatar = $avatar; $this->link = @$data['link']; $this->idNotification = $idNotification; $this->message = @$data['message']; $this->userId = $user->id; } public function broadcastOn() { return ['user-channel-'.$this->userId]; } }