目前我正在开发一个网站。我正在为我的一项功能开发 CRUD,并且在删除点之前没有遇到任何问题。我使用 bootstrap 模式窗口作为弹出的警告窗口,以阐明您希望删除您的d()}}
<div class="form-group">
<label for="name">Account Email:</label>
<input type="text" name ="email" value="{{$user -> email}}" class="form-control" readonly>
<div class="form-group">
<div class="text-centre">
<p></p>
<button type="button" data_userid="{{$user->id}}" class="btn btn-danger" data-toggle="modal" data-target="#deleteModal">
Delete
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteModalLabel">Are you sure?</h5>
<form action="{{ route('delete', $user)}} " method="post">
{{method_field('delete')}}
{{csrf_field()}}
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to permanetly delete your account?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">No, cancel</button>
<button type="submit" class="btn btn-danger">Yes, delete my account</button>
</div>
</form>
</div>
</div>
</div>
另外,每当我尝试从带有路由的下拉菜单访问页面时
<a class="dropdown-item" href="{{ route('users.destroy', $user)}}">
Delete Account
我遇到了一个空白页面,我确信这取决于参数。所以澄清一下,每当模式窗口弹出并且用户点击“是,删除我的帐户”时,什么都没有发生,窗口保持打开状态,我到页面的路由 {{ route('users.destroy', $user)}} 会导致空白页面。任何帮助是极大的赞赏!
斯蒂芬大帝
森栏
料青山看我应如是
慕尼黑5688855