我能问一下我在登录请求中做错了什么吗.我在php中设置了一个条件,如果登录过程中出现任何错误,可以重定向到自定义登录页面?我的代码如下:
<?php namespace App\Http\Requests;
use App\Http\Requests\Request;
class LoginRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'login_email' => 'required',
'login_password' => 'required'
];
}
public function messages()
{
return [
'login_email.required' => 'Email cannot be blank',
'login_password.required' => 'Password cannot be blank'
];
}
public function redirect()
{
return redirect()->route('login');
}
}
如果出现任何错误,该代码应该将从导航栏登录表单登录的用户重定向到主登录页面,但它似乎没有重定向.