簡體   English   中英

調用未定義的方法Illuminate \\ Database \\ Query \\ Builder :: notify()Laravel 5.4

[英]Call to undefined method Illuminate\Database\Query\Builder::notify() Laravel 5.4

我正在使用Laravel 5.4遇到上述error

調用未定義的方法Illuminate \\ Database \\ Query \\ Builder :: notify()

我遇到了這個解決方案

您必須在用戶模型中添加Illuminate \\ Notifications \\ Notifiable特征。 (鏈接: 調用未定義的方法Illuminate \\ Database \\ Query \\ Builder :: notify()

即使它對我不起作用

以下是我的User model我尚未為models創建任何文件夾,其路徑為默認路徑

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{

    use Notifiable;         

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password','phone','address','google_id',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];


    public function product()
    {
        return $this->hasMany('App\Product');
    }  
}

在出現上述錯誤期間,我當前的網址是
http:// localhost:8000 / password /電子郵件

在此處輸入圖片說明

我已經嘗試了許多以前的versions解決方案,但仍然無法正常工作?

更新1:這里是我在DROPBOX上的項目 https://www.dropbox.com/s/8jr6ls6xo7flbv8/myproject.zip?dl=0

我的興趣只是password reset http://localhost:8000/password/reset (我在這里報錯)

請幫助我擺脫這個錯誤感謝Adavce !!!

請幫助我擺脫這個錯誤感謝Adavce !!!

為什么您有重復的文件?

刪除User (2).phpCategory (2).php

由於某些原因,沒有通知特征的文件User(2).php被加載。 因此,您收到此錯誤。

只需刪除多余的文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM