The error you're seeing:
TypeError: Cannot assign __PHP_Incomplete_Class to property Filament\Actions\Exports\Jobs\PrepareCsvExport::$exporter of type Filament\Actions\Exports\Exporter
is caused during (un)serialization, which happens when the queued job is being processed. In a Laravel/Filament queued job, this usually means the PublicationExporter class is not available for the queue worker when it tries to handle the export.
This almost always points to a mismatch between your deployed code and what’s running in the worker, or an autoloading/class-loading issue.
Common causes and solutions:
1. Old queue worker process
Problem: The queue worker was started before you deployed the new exporter class, so it doesn’t have that class loaded.
Solution:
- Whenever you deploy new code that adds classes used by queued jobs (like your new exporter), you MUST restart your queue worker(s):
php artisan queue:restart
You mentioned you “have restarted the queue,” but make absolutely sure that all queue workers were restarted after deploying the code which contains PublicationExporter.
2. Cache Issues (config, route, autoload...)
Problem: Old cached files are causing autoloading problems.
Solution:
Clear all the caches after deploying. Run:
php artisan config:clear
php artisan cache:clear
php artisan route:clear
composer dump-autoload
Restart the worker afterward, just to be sure.
3. Deployment/Rsync miss
Problem: The deployed server is missing the PublicationExporter file (bad deploy, or the file not included).
Solution:
Double-check, on the deployed server, that app/Filament/Exports/PublicationExporter.php exists, and is readable by PHP (permissions etc).
4. Namespace/Composer classmap autoload
Problem: The namespace or class name doesn’t match the file location, or composer’s autoload cache hasn’t updated.
Solution:
- Ensure that
PublicationExporteris inapp/Filament/Exports/PublicationExporter.phpand the namespace isApp\Filament\Exports. - Run
composer dump-autoloadjust to be sure.
5. Queue serialization compatibility
If you made changes to the exporter between starting the export and the job running, the serialized job may have been invalidated. If so, retrying with a fresh queued export (after confirming all previous steps) should now work.
TL;DR Solution Steps
Follow these steps in order:
- Double-check that
PublicationExporter.phpexists on your server, in the correct location, with correct namespace. - Run on the server:
php artisan config:clear php artisan cache:clear php artisan route:clear composer dump-autoload - Restart ALL your queue workers:
php artisan queue:restart - Trigger the export again.
99% of the time, this will resolve the issue.
Why does a different exporter work?
If you have another exporter already working, it means its code was present before the current queue worker launched, or the worker hasn't been restarted since you added the new class. You need to re-load the worker so it can "see" the new class.
Let me know if this fixes it! If you still have trouble, please share:
- Which queue driver you’re using (
sync/redis/database/etc.) - How you run/deploy your queue workers (horizon, supervisor, etc.)
- The result of running
php artisan queue:restartand then retrying the export.