在我的 forge 生产服务器上,我配置了 Laravel 5.3 通知,所有的通知都使用了Illuminate\Bus\Queueabletrait 并实现了Illuminate\Contracts\Queue\ShouldQueue接口。这是在App\Notifications\BaseNotification我创建的一个类中完成的,我的所有通知类都扩展了。
我还有一个配置为运行队列的工作人员。
一切都很好,但是今晚我在执行通知时开始收到此错误:
Symfony\Component\Debug\Exception\FatalErrorException: Illuminate\Notifications\ChannelManager::sendNow(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "CenaZero\Notifications\Orders\OrderCompletedOwnerNotification" 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 /home/forge/cenazero.com.br/vendor/laravel/framework/src/Illuminate/Notifications/ChannelManager.php:64
Run Code Online (Sandbox Code Playgroud)
报告错误的类的代码如下:
<?php
namespace CenaZero\Notifications\Orders;
use CenaZero\Models\Order;
use CenaZero\Notifications\BaseNotification;
use Illuminate\Notifications\Messages\MailMessage;
use NotificationChannels\Gcm\GcmMessage;
use NotificationChannels\Zenvia\ZenviaMessage; …Run Code Online (Sandbox Code Playgroud)