一、laracasts/flash
下载:https://github.com/laracasts/flash
composer require laracasts/flash
在 @yield('content') 前面引入
在底部引入
二、登录
修改 app/Http/Controllers/Auth/LoginController.php
use Illuminate\Http\Request;
public function login(Request $request)
{
$this->validateLogin($request);
if ($this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request);
return $this->sendLockoutResponse($request);
}
if ($this->attemptLogin($request)) {
flash('欢迎回来')->success();
return $this->sendLoginResponse($request);
}
$this->incrementLoginAttempts($request);
return $this->sendFailedLoginResponse($request);
}
protected function attemptLogin(Request $request)
{
$credentials = array_merge($this->credentials($request), ['is_active'=>1]);
return $this->guard()->attempt(
$credentials, $request->has('remember')
);
}
修改 resources/lang/en/auth.php
'failed' => '密码错误或者邮箱未验证',
打开:http://localhost:8000/login
修改 users 表的 is_active = 0
修改 users 表的 is_active = 1