回答編集履歴

1

修正

2017/09/07 09:26

投稿

fagai
fagai

スコア2158

test CHANGED
@@ -23,3 +23,21 @@
23
23
  aタグのイベントでformが発火されるようになっており、formのmethodはPOSTになっています。
24
24
 
25
25
  そのため、getにしてあると動かないと思います。
26
+
27
+
28
+
29
+ ```php
30
+
31
+ <a href="{{ route('logout') }}"
32
+
33
+ onclick="event.preventDefault();
34
+
35
+ document.getElementById('logout-form').submit();"> Logout </a>
36
+
37
+ <form id="logout-form" action="{{ route('logout') }}" method="POST"←ここ style="display: none;">
38
+
39
+ {{ csrf_field() }}
40
+
41
+ </form>
42
+
43
+ ```