【问题标题】:Trait 'Illuminate\Foundation\Events\Dispatchable' not found未找到特征“Illuminate\Foundation\Events\Dispatchable”
【发布时间】:2018-11-14 06:34:38
【问题描述】:

我正在使用pragmarx/google2fa Laravel 包在我的 Laravel 应用程序上实现 Google 双重身份验证。它工作正常,但输入 OTP 密码后出现此错误 - corre

<?php

namespace PragmaRX\Google2FALaravel\Events;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class LoginSucceeded
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public $user;

/**
 * Create a new event instance.
 *
 * @param $user
 */
public function __construct($user)
{
    $this->user = $user;
}

}

对于 Laravel 5.3.xx 版本,有另一种方法吗?

【问题讨论】:

  • 请在使用的地方添加代码。
  • 对不起。帖子已更新。
  • 你试过composer du吗?
  • 我做到了。还在那里。我认为 Dispatchable 不适用于 Laravel 5.3。寻找解决方法。
  • 直到 Laravel 5.6 才引入。它在 Lumen 中也不可用,直到 5.8。

标签: laravel google-authenticator


【解决方案1】:

Illuminate\Foundation\Events\Dispatchable 包含在 Laravel 5.4 中。

事实上,我在自述文件中看到 pragmarx/google2fa 需要 Laravel 5.4+ 才能运行。

对不起!

【讨论】:

    猜你喜欢
    • 2019-11-01
    • 1970-01-01
    • 2019-07-12
    • 2020-08-16
    • 1970-01-01
    • 2018-06-20
    • 1970-01-01
    • 2018-02-11
    • 2018-09-16
    相关资源
    最近更新 更多