firefly-iii/app/Providers/BroadcastServiceProvider.php

42 lines
891 B
PHP
Raw Normal View History

2016-09-15 23:19:40 -05:00
<?php
/**
* BroadcastServiceProvider.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
declare(strict_types = 1);
2016-09-15 23:19:40 -05:00
namespace FireflyIII\Providers;
use Illuminate\Support\Facades\Broadcast;
2016-09-16 05:07:45 -05:00
use Illuminate\Support\ServiceProvider;
2016-09-15 23:19:40 -05:00
/**
* Class BroadcastServiceProvider
*
* @package FireflyIII\Providers
*/
2016-09-15 23:19:40 -05:00
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
/*
* Authenticate the user's personal channel...
*/
2016-09-16 05:07:45 -05:00
Broadcast::channel(
'App.User.*', function ($user, $userId) {
return (int)$user->id === (int)$userId;
}
);
2016-09-15 23:19:40 -05:00
}
}