tymondesigns/jwt-auth · error · Tymon\JWTAuth\Exceptions\PayloadException

The payload is immutable

Error message

The payload is immutable

What it means

Error "The payload is immutable" thrown in tymondesigns/jwt-auth.

Source

Thrown at src/Payload.php:225

     */
    #[\ReturnTypeWillChange]
    public function offsetGet($key)
    {
        return Arr::get($this->toArray(), $key);
    }

    /**
     * Don't allow changing the payload as it should be immutable.
     *
     * @param  mixed  $key
     * @param  mixed  $value
     *
     * @throws \Tymon\JWTAuth\Exceptions\PayloadException
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($key, $value)
    {
        throw new PayloadException('The payload is immutable');
    }

    /**
     * Don't allow changing the payload as it should be immutable.
     *
     * @param  string  $key
     * @return void
     *
     * @throws \Tymon\JWTAuth\Exceptions\PayloadException
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($key)
    {
        throw new PayloadException('The payload is immutable');
    }

    /**
     * Count the number of claims.

View on GitHub (pinned to 6c70930a92)

When it happens

Trigger: Thrown at src/Payload.php:225 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tymondesigns/jwt-auth@6c70930a92 (2026-08-21). Data as JSON: /api/errors/f837abb92e528143. Report an issue: GitHub.