Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP Laravel:我的通知赢了';无法保存到通知表_Php_Laravel - Fatal编程技术网

PHP Laravel:我的通知赢了';无法保存到通知表

PHP Laravel:我的通知赢了';无法保存到通知表,php,laravel,Php,Laravel,在病人要求医疗证明后,我正在向医生发送通知。它不会保存到通知表。错误为“找不到Class'Ramsey\Uuid\Lazy\lazyuidfromstring”。到目前为止,我已经尝试了编写器需要拉姆齐/uuid,编写器安装,编写器更新,编写器转储自动加载,但仍然不起作用。我还设置了EventServiceProvider。我是不是遗漏了什么?请帮忙。多谢各位 以下是我在SendMedicalCertificateRequest侦听器中的代码: class SendMedicalCertifi

在病人要求医疗证明后,我正在向医生发送通知。它不会保存到通知表。错误为
“找不到Class'Ramsey\Uuid\Lazy\lazyuidfromstring”
。到目前为止,我已经尝试了
编写器需要拉姆齐/uuid
编写器安装
编写器更新
编写器转储自动加载
,但仍然不起作用。我还设置了
EventServiceProvider
。我是不是遗漏了什么?请帮忙。多谢各位

以下是我在SendMedicalCertificateRequest侦听器中的代码:

class SendMedicalCertificateRequest
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object  $event
     * @return void
     */
    public function handle($event)
    {
        //User model uses Illuminate\Notifications\Notifiable trait
        $doctor = User::find($event->theDoctor->id);

        $doctor->notify(
            new MedicalCertificateRequestNotification(
                $event->theDoctor,
                $event->thePatient,
                $event->appointmentDate,
                $event->reason
            )
        );
    }
}
以下是我在MedicalCertificateRequestNotification通知中的代码:

class MedicalCertificateRequestNotification extends Notification implements ShouldBroadcast
{
    use Dispatchable, InteractsWithQueue, Queueable;

    public $theDoctor;
    public $thePatient;
    public $appointmentDate;
    public $reason;

    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct($theDoctor, $thePatient, $appointmentDate, $reason)
    {
        $this->theDoctor = $theDoctor;
        $this->thePatient = $thePatient;
        $this->appointmentDate = $appointmentDate;
        $this->reason = $reason;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['database'];
    }

    /**
     * Get the array representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function toArray($notifiable)
    {
        return [
            'theDoctor' => $this->theDoctor,
            'thePatient' => $this->thePatient,
            'appointmentDate' => $this->appointmentDate,
            'reason' => $this->reason
        ];
    }
}