输入banner图图片脚本导航/分类

Laravel5.1使用用户名登陆

如果你稍微研究下laravel登陆的话,能找到这段代码

public function loginUsername(){    return property_exists($this, 'username') ? $this->username : 'email';}

这里做了判断 是否存在属性username 没有及用email.

所以想用用户名登陆的话,就直接改下AuthController.php 增加个username的属性就OK了。

protected $username = 'name';

视图里

                    

原文:http://note.mango.im/article/26