Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="modal fade" id="delete-form" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel">Delete Account</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <form id="delete-form" action="{{ route('account.destroy', [$account->id]) }}" method="post">
- <input type="hidden" name="_method" value="delete">
- {{ csrf_field() }}
- <p>Are you sure you want to delete this data? </p>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
- <button type="submit" class="btn btn-primary">Save changes</button>
- </div>
- </form>
- </div>
- </div>
- </div>
- public function destroy(Account $account)
- {
- $findAccount = Account::find($account->id);
- if($findAccount->delete()){
- return redirect()->route('account.index')->with('success', 'Account details delete successfully!');
- }
- return back()->withInput()->with('error', 'Account details could not be deleted.');
- }
Add Comment
Please, Sign In to add comment