A token can be parsed from a string and transformed into a JsonWebToken instance. If the token cannot be parsed, the method will return null
. A parsed JWT does not mean that is a valid JWT. More information the JWT instance can be found in The JWT documentation.
use LittleApps\LittleJWT\Facades\LittleJWT;
$token = "ey...";
$jwt = LittleJWT::parse($token);
if (! is_null($jwt)) {
// The JWT was parsed.
// This does NOT mean the JWT is valid.
} else {
// The JWT wasn't parsed.
}