Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,
使用laravel内置的注册认证系统,注册账号,提示如下错误。Google之后,发现github的一个答案,解决了。分享一下
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,
如下,修改一下你的User模型即可
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Authenticatable as AuthenticableTrait; class User extends Model implements Authenticatable
{
use AuthenticableTrait;
其实5.5以上有更简洁的办法,用于登录认证的模型类需要继承 Illuminate\Foundation\Auth\User 基类,不然后面就会出现不能认证的窘况。
参考:https://github.com/jenssegers/laravel-mongodb/issues/702
http://laravelacademy.org/post/8270.html
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,的更多相关文章
- PHP Catchable fatal error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct()
laravel 项目的根目录下 运行composer update之后,报了包含 PHP Catchable fatal error: Argument 2 passed to Illuminate\ ...
- laravel Type error: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request
第一种情况: 传递给 UrlGenerator 的第二个参数是 Request 实例 你传进去的是null, 可以检查 config文件夹下的配置文件是否有用到 url() 函数的,如果有,将 url ...
- move_base Warning: Invalid argument "/map" passed to canTransform argument target_frame的解决方法
把global_costmap_params.yaml和local_costmap_params.yaml文件里的头几行去掉“/”,然后重新编译就可以了. 效果如下:
- Laravel Argument 1 passed to App\Models\Recipients\AlertRecipient::__construct() must be an instance of App\Models\Recipients\string, string given,
今天测试snipet的计划任务,库存低于警告值的时候,时候会会自动发送邮件到邮箱 class SendInventoryAlerts extends Command { /** * The name ...
- AbpZero之企业微信---登录(拓展第三方auth授权登录)---第一步:查看AbpZero的auth第三方登录的底层机制
在AbpZero框架中,auth登录接口位于Web.Core库下的Controllers文件夹的TokenAuthController.cs的ExternalAuthenticate方法 Extern ...
- jwt-auth错误小结
我用的是:"tymon/jwt-auth": "1.0.0-rc.1" 根据官方网站http://jwt-auth.readthedocs.io安装,并且ven ...
- Yii2 登录报错
当用数据库登录系统报如下错误时 PHP Recoverable Error – yii\base\ErrorException Argument 1 passed to yii\web\User::l ...
- python模块之PIL模块
PIL简介 什么是PIL PIL:是Python Image Library的缩写,图像处理的模块.主要的类包括Image,ImageFont,ImageDraw,ImageFilter PIL的导入 ...
- Asynchronous programming with Tornado
Asynchronous programming can be tricky for beginners, therefore I think it’s useful to iron some bas ...
随机推荐
- MySQL -- 主从复制的可靠性与可用性
主库A执行完成一个事务, 写入binlog ,记为 T1 然后传给从库B,从库B 接收该binlog ,记为 T2 从库B执行完成这个事务,记为 T3 同步延时: T3-T1 同一个事务,在 从库执行 ...
- THUWC2019爆零记
Day -1 现在在机房里,准备敲敲板子什么的. 今天晚上放假诶,要好好睡一下.好好睡是不可能的,这辈子不可能的. Day 0 现在在酒店,\(lwh\)神仙在超越,我打了个\(treap\)的板子就 ...
- 【BZOJ3733】[Pa2013]Iloczyn (搜索)
[BZOJ3733][Pa2013]Iloczyn (搜索) 题面 BZOJ 题解 把约数筛出来之后,直接爆搜,再随便剪枝就过了. 最近一句话题解倾向比较严重 #include<iostream ...
- BZOJ 2668 [cqoi2012]交换棋子 | 最小费用最大流
传送门 BZOJ 2668 题解 同时分别限制流入和流出次数,所以把一个点拆成三个:入点in(x).中间点mi(x).出点ou(x). 如果一个格子x在初始状态是黑点,则连(S, mi(x), 1, ...
- angular的一次小错误
前台页面的错误: 在使用angular的时候,发现了标签等不能解析,忙了一个小时没找见错误在哪,最后才发现,原来ng-app,ng-controller等声明错了地方,声明在了div上,而不是在bod ...
- 三、spring boot 1.5.4 web容器定制(端口号等修改)
spring boot 默认采用tomcat作为嵌入的web容器 定制方式有三种 1. 2.如下 @Component public class CustomizationBean implement ...
- maven 整合支付宝,导入alipay-sdk-java包到本地仓库
maven 整合支付宝,导入alipay-sdk-java包到本地仓库 1.环境变量添加: MAVEN_HOME:(maven位置) M2_HOME:(maven位置) PATH:%M2_HOME ...
- sqlserver运行脚本数据出现 内存不足的解决办法
但是当数据库导出脚本很大,用Microsoft SQL Server Management Studio执行脚本时,往往会遇到“内存不足”的提示. 解决办法: 用微软自带的sqlcmd工具,可以导入执 ...
- swift学习笔记3
1.在 Swift 中,枚举类型是一等(first-class)类型.它们采用了很多在传统上只被类(class)所支持的特性,例如计算型属性(computed properties),用于提供枚举值的 ...
- JavaScript编写风格指南 (三)
七(七):严格模式 // 严格模式应当仅限在函数内部使用,千万不要在全局使用 //不好的写法:全局使用严格模式"user strict"; function doSomething ...