Я пытаюсь отправить обычное уведомление пользователю с помощью notify
метод.
Мой код действительно прост.
auth()->user()->notify(new AppointmentRequestNotification($customerRequest));
И мой класс уведомлений:
<?php
namespace App\Notifications;
use App\CustomerRequest;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class AppointmentRequestNotification extends Notification implements ShouldQueue
{
use Queueable;
private $customerRequest;
public function __construct( CustomerRequest $customerRequest )
{
$this->customerRequest = $customerRequest;
$this->onQueue('notifications');
}
.
.
.
public function toMail($notifiable)
{
return (new MailMessage)
->subject('You Appointment Request Has Been Sent')
->line('Your appointment request has been sent! You will be contacted by the provider’s office shortly to confirm appointment details.')
->line($this->customerRequest->emailDetailView());
}
}
И когда я открываю неудачные задания, это исключение:
Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Illuminate\Notifications\Channels\MailChannel::send() must be an instance of Illuminate\Notifications\Notification, instance of __PHP_Incomplete_Class given, called in /home/forge/medixaiddemo.staging71.agileelement.com/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php on line 113 in /home/forge/medixaiddemo.staging71.agileelement.com/vendor/laravel/framework/src/Illuminate/Notifications/Channels/MailChannel.php:46
Задача ещё не решена.
Других решений пока нет …