for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Mercure;
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Hmac\Sha256;
use Lcobucci\JWT\Signer\Key;
final class JwtProvider
{
private $secret;
public function __construct(string $secret)
$this->secret = $secret;
}
public function __invoke(): string
return (new Builder())
->withClaim('mercure', ['publish' => ['*']])
->getToken(new Sha256(), new Key($this->secret));