This repository has been archived on 2021-01-24. You can view files and clone it, but cannot push or open issues or pull requests.
laravel-elearning/app/Providers/BroadcastServiceProvider.php
2016-09-01 11:37:49 +02:00

27 lines
543 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
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;
});
}
}