3
沖水()方法按照Laravel 4 Documentation on queued Events,我想註冊一個事件沖水是這樣的:排隊事件:事件::沒有找到
Event::flusher('foo.bar', function($data)
{
Mail::send(array('emails.notification', 'emails.notification_text'), array('content' => $data), function($message)
{
$message
->to('[email protected]', 'My Name')
->bcc('[email protected]')
->subject('Message from Listener');
});
});
但我得到在加載以下錯誤腳本:
調用未定義的方法照亮\活動\調度::沖水()
我也找不到在源這種方法代碼L4。但是,當我從Event::flusher()
更改爲Event::listen()
時,一切都按預期工作。
所以我的猜測是,該文檔不是最新的和Event::flusher()
方法已經被刪除,因爲Event::listen()
做同樣的工作。或者這兩種方法有什麼區別,我的代碼中有錯誤?