我经常创建Laravel登录,它运行顺利,但我不明白的Laravel php artisan make:auth
运行的实际进程。现在我想尝试创建这个登录过程我自己了解的实际进程
我试图让我自己没有Laravel make:auth
运行在登录过程。创建与哈希密码的用户表。在Auth::attempt
登录时总是false
,为什么呢?
public function authenticate(Request $request)
{
$credentials = $request->only('email', 'password');
if (Auth::attempt($credentials)) {
// Authentication passed...
return redirect()->intended('dashboard');
}
}
此功能是Laravel手动验证用户的文档中,如果我dd(Auth::attempt($credentials));
总是返回false
,所以它不能去的路线/home
:
我注册遥控器是这样的:
public function create()
{
$user = User::create([
'name' => Input::get('name'),
'email' => Input::get('email'),
'password' => Hash::make(Input::get('password')),
]);
return redirect::back();
}
如何面对呢?
我认为laravel使用JSON回调和中间件和一些处理会话和饼干更好地使用基本身份验证,并逐步向正确前面所有的工作检查结束,看看数据发送到后端currectly