Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object Laravel 5.3

The problem is that I have two Laravel projects working on Laravel 5.1 and 5.3 and sharing common database. Both projects are placed on different subdomains up and running. Now while using queue driver as database for both projects I am using 5.3 demon to run on 5.1 queued jobs I am getting following error.

PHP Fatal error:  method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "App\Jobs\StoreAppliedjob" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition  in /Applications/MAMP/htdocs/admin-badiyajobs/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php on line 83

                                                                                                                                                                                                                                                                                                                        [Symfony\Component\Debug\Exception\FatalErrorException]       

The 5.1 queue is working fine when run with queue listener on 5.1 . Note that I can't use separate cron on both projects to process queue as that will mess up everything. Please suggest what should I do ?

like image 486
Nitesh Verma Avatar asked Oct 21 '25 17:10

Nitesh Verma


1 Answers

The queue serializes the Job before sending it to the queue and unserializes it when it's handled. You'll need the App\Jobs\StoreAppliedjob on the location where it's being handled.

like image 180
Robert Avatar answered Oct 24 '25 07:10

Robert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!