【发布时间】:2017-12-12 10:46:26
【问题描述】:
我正在使用Laravel 5.4 得到上述error
调用未定义的方法 Illuminate\Database\Query\Builder::notify()
我遇到过这个解决方案
您必须在用户模型中添加 Illuminate\Notifications\Notifiable trait。 (链接:Call to undefined method Illuminate\Database\Query\Builder::notify())
即使它不适合我
下面是我的Usermodel我还没有为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/email
我已经尝试了很多以前的versions 解决方案,但仍然不起作用?
更新 1:这是我在 DROPBOX 上的项目 https://www.dropbox.com/s/8jr6ls6xo7flbv8/myproject.zip?dl=0
我的兴趣只是password reset http://localhost:8000/password/reset(我遇到错误的地方)
请帮助我摆脱这个错误,感谢 Adavce !!!
请帮助我摆脱这个错误,感谢 Adavce !!!
【问题讨论】:
-
您是否已完成此答案中列出的所有内容:stackoverflow.com/a/40314170/1287695?
-
@kjones,是的,我已经尝试过那里提到的那些东西
-
我已将我的项目上传到
drop boxdropbox.com/s/8jr6ls6xo7flbv8/myproject.zip?dl=0 请点击此网址进行测试localhost:8000/password/reset -
@EaB 我已经看到你的代码,你试图通知用户?
-
@AdnanMumtaz,我正在尝试使用 laravel 内置的默认忘记密码功能。如果您有任何解决方案,请发布
标签: php laravel laravel-5.4