2016-09-03 21:09:00 +00:00
|
|
|
<?php
|
|
|
|
|
2017-04-15 00:46:50 +00:00
|
|
|
namespace Pterodactyl\Providers;
|
2016-09-03 21:09:00 +00:00
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Illuminate\Support\Facades\Broadcast;
|
|
|
|
|
|
|
|
class BroadcastServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*/
|
2023-02-23 19:30:16 +00:00
|
|
|
public function boot(): void
|
2016-09-03 21:09:00 +00:00
|
|
|
{
|
|
|
|
Broadcast::routes();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Authenticate the user's personal channel...
|
|
|
|
*/
|
|
|
|
Broadcast::channel('App.User.*', function ($user, $userId) {
|
|
|
|
return (int) $user->id === (int) $userId;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|