我需要幫助來解決通知系統的問題。在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