フォームの自動提出を停止するにはどうすればよいですか?現在、以下のコントローラ機能(deleteAccount)は、ページがロードされた直後に実行されますが、ボタンをクリックしたときにのみ起動されるべきです。フォームの自動提出ページの読み込み
関連の路線:
Route::resource("myaccount", "MyAccountController");
Route::get("myaccount", "[email protected]");
関連するコントローラー機能:
public function deleteAccount(){
$user = \Auth::user();
\Auth::logout();
$user->delete();
flash()->success("Account Deleted Successfully!");
return redirect("/");
}
関連するビューコード:
{{ Form::open(array('action' => '[email protected]')) }}
{{ method_field('get') }}
<button type="submit">Delete Account!</button>
{{ Form::close() }}