As per the RFC7519,the payload of a JWS may be detached. This framework supports this feature.
There is not much difference between the creation of a JWS with or without detached payload. The following example comes from the JWS Creation page. There is only one argument that will change during the call of withPayload.
// The algorithm manager with the HS256 algorithm.
->withPayload($payload,true)// /!\ Here is the change! We set the payload and we indicate it is detached
->addSignature($jwk,['alg'=>'HS256'])// We add a signature with a simple protected header
And voilà! When you will serialize this token, the payload will not be present.
The loading of a signed token with a detached payload is as easy as when the payload is attached. The only difference is that you have to pass the payload to the JWS Verifier when you want to check the signature.