ronon liked a comment+100 XP
5mos ago
Since batch callbacks are serialized and executed at a later time by the Laravel queue, you should not use the $this variable within the callbacks. https://laravel.com/docs/9.x/queues#dispatching-batches
Serializer does not know the context of $this. Try something like:
ReportService::removeDuplicatedEmails();
BonusService::assignBonus($reportId);
Or, you can even dispatch these as another job.