server/src/app/Providers/BroadcastServiceProvider.php
author ymh <ymh.work@gmail.com>
Mon, 17 Oct 2016 18:07:53 +0200
changeset 346 4cd0f8c936ed
parent 280 59a2c10ac9b8
permissions -rw-r--r--
upgrade build and delivery process for integration

<?php

namespace CorpusParole\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;
        });
    }
}