0
composer require firebase/php-jwt:^2.2

install is OK

So



    use \Firebase\JWT\JWT;
    $key = "example_key";
    $payload = array(
        "iss" => "http://example.org",
        "aud" => "http://example.com",
        "iat" => 1356999524,
        "nbf" => 1357000000
    );
    $jwt = JWT::encode($payload, $key);

Error

Class 'Firebase\Jwt\Jwt' not found

Help me!!!

Detail Error

Dettaglio Errore

Thank You

Daniel
  • 21
  • 3

2 Answers2

1

The code in index.php doesn't look like code you wrote here. Try to use \Firebase\JWT\JWT; in index.php. Also PHP namespaces are case sensitive, so make sure you wrote it correct or use IDE's autocomplete.

Yoowhi
  • 66
  • 5
0

namespace Firebase\Authentication;

You can use this on this file path for crating this file path object.

src/public/firebase/php-jwt/Authentication/JWT.php
Tushar Asodariya
  • 629
  • 2
  • 7
  • 20