use(BearerAuth::bearerAuth($token)); $app->get("/", function ($context) { return $context->json([ "message" => "Protected route accessed successfully", ]); }); $app->run();