我有两个使用表单登录和注册的divs.login可以正常工作,但是register使我的错误页面过期了,我什至添加了@csrf但它仍然无法正常工作,但它可以在登录表单上正常工作
<form action="{{route('register')}}" method="POST">
@csrf
<div class="textbox">
<i class="icon-user"></i>
<input type="name" placeholder="Username" name="name" class="inputs">
</div>
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="textbox">
<i class="icon-lock"></i>
<input type="password" placeholder="Password" name="password" class="inputs" autocomplete="new-password">
</div>
<div class="textbox">
<i class="icon-lock"></i>
<input type="password" placeholder="confirm password" name="password_confirmation" value="" class="inputs">
</div>
<div id="terms"><input type="checkbox"> I have read and agreed to the <a href="">terms and conditions</a></div>
<input type="submit" value="Register" class="submit-buttons">
</form>
答案 0 :(得分:1)
删除以下行之一:
<input type="hidden" name="_token" value="{{ csrf_token() }}">
或
@csrf