Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mahin's avatar
Level 28

Class "Firebase\JWT\JWT" not found

Hi, I'm using queue to dispatch job and everything works fine when used

QUEUE_CONNECTION=sync

but I get this error


dev.ERROR: Class "Firebase\JWT\JWT" not found {"exception":"[object] (Error(code: 0): Class \"Firebase\JWT\JWT\" not found at /home/forge/myapp.com/app/Services/MyService.php:999)

when I used

QUEUE_CONNECTION=redis

I'm using Laravel Horizon and the process is running from my project root directory using dimon

php artisan horizon

Please, advice. Any help will be appreciated.

Thanks, Ahmed

0 likes
5 replies
Mahin's avatar
Level 28

@Sinnbeck

I'm using Firebase\JWT\JWT::encode once in my entire class and I'm importing it using:

return JWT::encode($claims, $this->apiSecret, "HS256");
use Firebase\JWT\JWT;
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

My best guess is that you need to restart horizon (do so every time you change code)

During your application's deployment process, you should instruct the Horizon process to terminate so that it will be restarted by your process monitor and receive your code changes:

php artisan horizon:terminate 
1 like

Please or to participate in this conversation.