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()
做同样的工作。或者这两种方法有什么区别,我的代码中有错误?