Closed
Description
I propose we make the defaultName
function public static
. That way we can use it to generate the beams token.
I want to use it like in the example below (I would place it inside my UserController
).
/**
* Generate a Pusher Beams auth token to allow a user to associate their device with their user id.
* The token is valid for 24 hours.
*
* @throws Exception
*
* @return array
*/
public function generateBeamsToken()
{
$beamsClient = new PushNotifications([
'instanceId' => Config::get('services.pusher.beams_instance_id'),
'secretKey' => Config::get('services.pusher.beams_secret_key'),
]);
return $beamsClient->generateToken(PusherChannel::defaultName(Auth::user()));
}
Would that be ok? Can I submit the PR?
Or maybe there is another way of accomplishing this?