refactor: susun semula struktur folder — Laravel source ke src/
This commit is contained in:
44
vendor/laravel/framework/src/Illuminate/Broadcasting/InteractsWithBroadcasting.php
vendored
Normal file
44
vendor/laravel/framework/src/Illuminate/Broadcasting/InteractsWithBroadcasting.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Broadcasting;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
use function Illuminate\Support\enum_value;
|
||||
|
||||
trait InteractsWithBroadcasting
|
||||
{
|
||||
/**
|
||||
* The broadcaster connection to use to broadcast the event.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $broadcastConnection = [null];
|
||||
|
||||
/**
|
||||
* Broadcast the event using a specific broadcaster.
|
||||
*
|
||||
* @param \UnitEnum|array|string|null $connection
|
||||
* @return $this
|
||||
*/
|
||||
public function broadcastVia($connection = null)
|
||||
{
|
||||
$connection = enum_value($connection);
|
||||
|
||||
$this->broadcastConnection = is_null($connection)
|
||||
? [null]
|
||||
: Arr::wrap($connection);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the broadcaster connections the event should be broadcast on.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function broadcastConnections()
|
||||
{
|
||||
return $this->broadcastConnection;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user