Update source into github
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class Notification_Pay_Success implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
protected string $message;
|
||||
protected int $user;
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($message = '',$user = 0)
|
||||
{
|
||||
//
|
||||
$this->message = $message;
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
return new PrivateChannel('Payment-Success.' . $this->user);
|
||||
}
|
||||
|
||||
public function broadcastAs()
|
||||
{
|
||||
return 'Payment.Success.Event';
|
||||
}
|
||||
public function broadcastWith()
|
||||
{
|
||||
return [
|
||||
'message' => $this->message
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user