我需要帮助来解决通知系统的问题。在Laravel 5.4通知中找不到类'Illuminate Mail Events MessageSent'
这里是我的通知类:
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class ApplicationReceived extends Notification
{
use Queueable;
private $testCode;
private $recipientName;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($testCode='',$name='')
{
$this->testCode=$testCode;
$this->recipientName=$name;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->greeting("Dear ".$this->recipientName)
->subject('Your Application Received for The Entrepreneur')
->line("Your application to participate in The Entrepreneur project has been received by us")
->line("Follow the link below to take a test to complete your application")
->action('Take Test', url('/taketest/'.$this->testCode))
->line('Thank you for your interest in The Entrepreneur project!');
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
而这正是我把它叫做:
//Notify the candidate
$candidate->notify(new ApplicationReceived($candidate->testcode, $candidate->othernames));
return redirect('/signup')->with('msg', "<div class='alert alert-success'><strong>Your registration information was successfully submitted!</strong><br /> Please check your email for a link to take a test to complete your enrollment!!!</div>");
当应用程序运行时,它发出的通知,但随后抛出了以下致命错误信息
FatalErrorException在Mailer.php行470: 班“照亮\邮件\活动\ MessageSent”未找到
我会感谢所有帮助指出我要去的地方错在这里。
尝试重新运行'作曲家update'和/或run'composer自卸autoload'请MessageSent中的最后一个版本中加入(5.4.18)4天前 – dparoli