for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AlexHnydiuk\Laracent;
use GuzzleHttp\Client as HttpClient;
use Illuminate\Support\ServiceProvider;
use Illuminate\Broadcasting\BroadcastManager;
class LaracentServiceProvider extends ServiceProvider
{
/**
* Add centrifugo broadcaster.
*
* @param \Illuminate\Broadcasting\BroadcastManager $broadcastManager
*/
public function boot(BroadcastManager $broadcastManager)
$broadcastManager->extend('centrifugo', function ($app) {
return new LaracentBroadcaster($app->make('centrifugo'));
});
}
* Register the service provider.
* @return void
public function register()
$this->app->singleton('centrifugo', function ($app) {
$config = $app->make('config')->get('broadcasting.connections.centrifugo');
$http = new HttpClient();
return new Laracent($config, $http);
$this->app->alias('centrifugo', 'AlexHnydiuk\Laracent\Laracent');
$this->app->alias('centrifugo', 'AlexHnydiuk\Laracent\Contracts\Centrifugo');