AuthToken.php
public static function getPayload($token, $jsonDecode = true)
    {
        // Split parts
        list($payload, $signature) = explode('.', $token);

        // Decode first part
        $payloadJSON = base64_decode($payload);

        // Choose to decode or not
        if ($jsonDecode) {
            return json_decode($payloadJSON, true);
        }

        // Return json
        return $payloadJSON;
    }
public static function getPayload($token, $jsonDecode = true)
    {
        // Split parts
        list($payload, $signature) = explode('.', $token);

        // Decode first part
        $payloadJSON = base64_decode($payload);

        // Choose to decode or not
        if ($jsonDecode) {
            return json_decode($payloadJSON, true);
        }

        // Return json
        return $payloadJSON;
    }
public static function getPayload ( $ token , $ jsonDecode = true ) { // Split parts list ( $ payload , $ signature ) = explode ( '.' , $ token ) ; // Decode first part $ payloadJSON = base64_decode ( $ payload ) ; // Choose to decode or not if ( $ jsonDecode ) { return json_decode ( $ payloadJSON , true ) ; } // Return json return $ payloadJSON ; }
Get the payload from the token.

@param string  $token      The authentication token.
@param boolean $jsonDecode Whether to decode the payload from json to array.

@return mixed Array or json string according to $jsonDecode value.
Get the payload from the token .