我的视图中包含以下HTML。它使用了boostrap模式。它适用于登录和重定向,但在登录尝试失败时,它不会将用户重定向回实际的登录页面。 <form class="form-horizontal" method="POST" action="{{ route('login') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<div class="col-md-12">
<input id="email" type="email" placeholder = "Email address.." class="form-control" name="email" value="{{ old('email') }}" required autofocus>
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<div class="col-md-12">
<input id="password" type="password" placeholder = "Password" class="form-control" name="password" required>
</div>
</div>
</div>
<p class = "small" style="padding:10px;">By signing up, you are indicating that you have read and agree to the <a href="">Terms of Use</a> and <a href="#">Privacy Policy</a>.</p>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Enter</button>
</div>
</form>
这不应该让用户回到登录页面吗?
TryParse
答案 0 :(得分:0)
实际的重定向问题可能是由被叫控制器引起的。 请检查登录后的功能/方法,检查是否有某事。喜欢
return Redirect::back()->withErrors(['msg', 'The Message']);
在验证结束时。
Here您可以找到有关重定向的相关帖子。
有关重定向的更多信息,请查看documentation。关于带参数的重定向函数也有很好的例子