Files
firefly-iii/app/Providers/BroadcastServiceProvider.php

44 lines
948 B
PHP
Raw Normal View History

2016-09-16 06:19:40 +02:00
<?php
/**
* BroadcastServiceProvider.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types=1);
2016-09-16 06:19:40 +02:00
namespace FireflyIII\Providers;
use Illuminate\Support\Facades\Broadcast;
2016-09-16 12:07:45 +02:00
use Illuminate\Support\ServiceProvider;
2016-09-16 06:19:40 +02:00
/**
* Class BroadcastServiceProvider
*
* @package FireflyIII\Providers
*/
2016-09-16 06:19:40 +02: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 12:07:45 +02:00
Broadcast::channel(
'App.User.*', function ($user, $userId) {
return (int)$user->id === (int)$userId;
}
);
2016-09-16 06:19:40 +02:00
}
}