mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
30 lines
581 B
PHP
30 lines
581 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\Facades\Broadcast;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class BroadcastServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
Broadcast::routes();
|
|
|
|
/*
|
|
* Authenticate the user's personal channel...
|
|
*/
|
|
Broadcast::channel(
|
|
'App.User.*',
|
|
function ($user, $userId) {
|
|
return (int)$user->id === (int)$userId;
|
|
}
|
|
);
|
|
}
|
|
}
|