Completed
Branch master (a6481d)
by Fèvre
02:09
created

BroadcastServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace Xetaravel\Providers;
3
4
use Illuminate\Support\ServiceProvider;
5
use Illuminate\Support\Facades\Broadcast;
6
7
class BroadcastServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap any application services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        Broadcast::routes();
17
18
        /*
19
         * Authenticate the user's personal channel...
20
         */
21
        Broadcast::channel('Xetaravel.User.*', function ($user, $userId) {
22
            return (int) $user->id === (int) $userId;
23
        });
24
    }
25
}
26