<?php


namespace App\Components;


use Pusher\Pusher;

class PusherService {

	protected $pusher;

	public function __construct() {
		$app_id      = config( 'constants.PUSHER_APP_ID' );
		$app_key     = config( 'constants.PUSHER_APP_KEY' );
		$app_secret  = config( 'constants.PUSHER_APP_SECRET' );
		$app_cluster = config( 'constants.PUSHER_APP_CLUSTER' );
		$host        = config( 'constants.PUSHER_HOST' );
		$port        = config( 'constants.PUSHER_PORT' );
		$pusher      = new Pusher( $app_key,
			$app_secret,
			$app_id,
			[ 'cluster' => $app_cluster, 'debug' => true, 'scheme' => 'https' ],
			$host,
			$port );
		$this->pusher = $pusher;
	}

	public function getClient()
	{
		return $this->pusher;
	}
}