280
|
1 |
<?php |
|
2 |
|
|
3 |
namespace CorpusParole\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 |
* @return void |
|
14 |
*/ |
|
15 |
public function boot() |
|
16 |
{ |
|
17 |
Broadcast::routes(); |
|
18 |
|
|
19 |
/* |
|
20 |
* Authenticate the user's personal channel... |
|
21 |
*/ |
|
22 |
Broadcast::channel('App.User.*', function ($user, $userId) { |
|
23 |
return (int) $user->id === (int) $userId; |
|
24 |
}); |
|
25 |
} |
|
26 |
} |