Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Providers/BroadcastServiceProvider.php
7432 views
1
<?php
2
3
namespace Pterodactyl\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Illuminate\Support\Facades\Broadcast;
7
8
class BroadcastServiceProvider extends ServiceProvider
9
{
10
/**
11
* Bootstrap any application services.
12
*/
13
public function boot(): void
14
{
15
Broadcast::routes();
16
17
/*
18
* Authenticate the user's personal channel...
19
*/
20
Broadcast::channel('App.User.*', function ($user, $userId) {
21
return (int) $user->id === (int) $userId;
22
});
23
}
24
}
25
26