I try to make custom login in laravel I got an error like ...
ErrorException in EloquentUserProvider.php line 116: Undefined index: password
my controller code ...
public function logincheck(Request $request)
{
$this->validate($request, [
'Email' => 'required',
'password' => 'required',
]);
$email = $request->Email;
$password = md5($request->get('password'));
if(Auth::attempt(['Email' => $request->get('Email'), 'Password' =>$password)]))
{
return ('ok');
}
return ('no');
}
this is my blade file
<form role="form" action="" method="POST">
<fieldset>
<div class="row">
<div class="col-sm-12 col-md-10 col-md-offset-1 ">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="glyphicon glyphicon-user"></i>
</span>
<input class="form-control" placeholder="Email" name="Email" type="email" autofocus>
</div>
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="glyphicon glyphicon-lock"></i>
</span>
<input class="form-control" placeholder="password" name="password" type="password" value="">
<input type="hidden" name="_token" value="">
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-lg btn-primary btn-block" value="Sign in">
</div>
</div>
</div>
</fieldset>
</form>
via Saran