我觉得这里应该改进
<a href="{{ route('logout') }}"
onclick="event.preventDefault();document.getElementById('logout-form').submit();">
退出登录
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
把 href="{{ route('logout') }}" 这个去掉,因为点击也不会执行,或者把 标签改成button 标签
其实没有什么问题,只是有点强迫症一样。看着那个多余的不舒服。
推荐文章: