Passed
Pull Request — master (#47)
by
unknown
06:41
created

BroadcastServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Providers;
4
5
use Illuminate\Support\Facades\Broadcast;
6
use Illuminate\Support\ServiceProvider;
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
}
27