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

LKCPH's avatar
Level 1

Running Queue jobs returns: ReflectionException: Method __PHP_Incomplete_Class::handle() does not exist

Hi everyone,

I deploy with Forge and Envoyer in Laravel 5.3.

I run my queue with the database driver, so i have a table with my jobs.

I have created an empty test class with :

php artisan make:job SendUserWelcomeEmail

The job works and gets run locally but after i deploy, i get the error when the job fires:

ReflectionException: Method __PHP_Incomplete_Class::handle() does not exist

So the Job gets added correctly to the table, the worker correctly picks it up, but Laravel then somehow can't find or unserialize the class, even though it resides in the app/Jobs folder, as it should like it does in homestead (because i push to deploy so the files are the same).

Has anyone had similar problems?

Thanks in advance!

0 likes
6 replies
dhonions's avatar

Hi, I've just come across the same issue in 5.4 on Forge and Envoyer. Did you find a solution?

luisdalmolin's avatar

I'm getting this error too, only in two particular jobs. Any solutions?

AndyDunn's avatar

Yea, I'm getting this as well. Any solution yet?

QuinnJohns's avatar

I also had this problem and found a fix. However, it turned out to be the result of multiple environments.

For example:

  • I have a production and staging environment.
  • The workers (Supervisor) on the server all use the same jobs table.

The problem is the workers--even after restarted to clear their cache--still only read the production environment's files so they truly cannot find the new Job class file.

The solution I cooked up was:

  • Created a new migration for jobs_staging
  • Updated /config/queue.php to add a new connection that looks at this new jobs table:
'staging' => [
    'driver' => 'database',
    'table' => 'jobs_staging',
    'queue' => 'default',
    'retry_after' => 90,
],
  • Updated staging environment's .env file on the server and changed queue to use new connection: queue=staging
  • Cleared the staging environment's config cache on the server: php artisan config:cache
  • Updated Supervisor to include a new worker for staging:
[program:laravel-worker-staging]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/staging/current/artisan queue:work staging --daemon --sleep=3 --tries=3
autostart=true
autorestart=true
user=username_goes_here
numprocs=1
redirect_stderr=true
stdout_logfile=/path/to/log/supervisor/laravel-worker-staging.log

  • Updated Supervisor: sudo supervisorctl reread
  • Restated Supervisor: sudo supervisorctl restart

This fixed the problem for me.

pn0326's avatar

It is a late post, but I too face the same issue and found the file name of the job file and the class name of the job is not matching.

Please or to participate in this conversation.