koel/app/Providers/BroadcastServiceProvider.php

27 lines
543 B
PHP
Raw Normal View History

2016-09-26 06:30:00 +00:00
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
2016-09-26 07:33:53 +00:00
use Illuminate\Support\ServiceProvider;
2016-09-26 06:30:00 +00:00
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;
});
}
}