5 :
,
"require": {
...
"firebase/php-jwt": "^5.0",
},
:
use Firebase\JWT\JWT;
...
protected function generateJwt(){
if (config('jwt.secret')) {
$now_seconds = time();
$payload = array(
"iss" => ...,
"sub" => ...,
"aud" => ...,
"iat" => $now_seconds,
"exp" => $now_seconds + 60*60,
);
$this->jwt = JWT::encode($payload, config('jwt.secret'), "HS256");
}
Log::error("Missing JWT_SECRET in .env");
}