質問編集履歴

5

修正

2019/09/05 03:15

投稿

dato
dato

スコア64

test CHANGED
File without changes
test CHANGED
@@ -16,9 +16,9 @@
16
16
 
17
17
  404 not found
18
18
 
19
-
19
+
20
-
21
- The GET method is not supported for this route. Supported methods: POST.がでる
20
+
21
+
22
22
 
23
23
  ```
24
24
 
@@ -232,6 +232,8 @@
232
232
 
233
233
  同じコントローラー内で、異なる値にたいして$requestがつかえないのでしょうか?
234
234
 
235
+ @csrfにしたところThe GET method is not supported for this route. Supported methods: POST.がでる
236
+
235
237
  ### 補足情報(FW/ツールのバージョンなど)
236
238
 
237
239
 

4

エラーメッセージの追加

2019/09/05 03:15

投稿

dato
dato

スコア64

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,10 @@
16
16
 
17
17
  404 not found
18
18
 
19
+
20
+
21
+ The GET method is not supported for this route. Supported methods: POST.がでる
22
+
19
23
  ```
20
24
 
21
25
 

3

追加

2019/09/04 16:51

投稿

dato
dato

スコア64

test CHANGED
File without changes
test CHANGED
@@ -104,6 +104,18 @@
104
104
 
105
105
 
106
106
 
107
+ public function validation(ValiRequest2 $request){
108
+
109
+ $laravelcontact= new LaravelContact();
110
+
111
+ $laravelcontact->name=$request->input('name');
112
+
113
+ $laravelcontact->password=$request->input('password');
114
+
115
+ $laravelcontact->save();
116
+
117
+ return view('Login');
118
+
107
119
 
108
120
 
109
121
  public function LogVali(ValiRequest3 $request){

2

細部の追加

2019/09/04 11:27

投稿

dato
dato

スコア64

test CHANGED
File without changes
test CHANGED
@@ -116,6 +116,96 @@
116
116
 
117
117
  ```
118
118
 
119
+ valiRequest3
120
+
121
+ ```ここに言語を入力
122
+
123
+ <?php
124
+
125
+
126
+
127
+ namespace App\Http\Requests;
128
+
129
+
130
+
131
+ use Illuminate\Foundation\Http\FormRequest;
132
+
133
+
134
+
135
+
136
+
137
+ class ValiRequest3 extends FormRequest
138
+
139
+ {
140
+
141
+ /**
142
+
143
+ * Determine if the user is authorized to make this request.
144
+
145
+ *
146
+
147
+ * @return bool
148
+
149
+ */
150
+
151
+ public function authorize()
152
+
153
+ {
154
+
155
+ return true;
156
+
157
+ }
158
+
159
+
160
+
161
+ /**
162
+
163
+ * Get the validation rules that apply to the request.
164
+
165
+ *
166
+
167
+ * @return array
168
+
169
+ */
170
+
171
+ public function rules()
172
+
173
+ {
174
+
175
+ return [
176
+
177
+ 'name2'=>'required|max:32',
178
+
179
+ 'password2'=>'required',
180
+
181
+ //
182
+
183
+ ];
184
+
185
+ }
186
+
187
+ public function messages(){
188
+
189
+ return[
190
+
191
+ 'name2.required'=>'名前を入力してください。',
192
+
193
+ 'name2.max'=>'名前を32文字以下にしてください。',
194
+
195
+ 'password2.required'=>'パスワードを入力してください。',
196
+
197
+ ];
198
+
199
+ }
200
+
201
+
202
+
203
+ }
204
+
205
+
206
+
207
+ ```
208
+
119
209
  ### 試したこと
120
210
 
121
211
 

1

細部の記述

2019/09/04 11:25

投稿

dato
dato

スコア64

test CHANGED
File without changes
test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  ### 該当のソースコード
24
24
 
25
- Login画面
25
+ Login.blade.php
26
26
 
27
27
  ```ここに言語名を入力
28
28
 
@@ -70,17 +70,39 @@
70
70
 
71
71
  ```
72
72
 
73
+ web.php
74
+
73
75
  ```ここに言語を入力
74
76
 
75
77
  Route::post('/LogVali', 'AdministratorController@LogVali');
76
78
 
77
79
  ```
78
80
 
81
+ AdministratorController.php
82
+
79
83
  ```ここに言語を入力
84
+
85
+ namespace App\Http\Controllers;
86
+
87
+
88
+
89
+ use Illuminate\Foundation\Bus\DispatchesJobs;
90
+
91
+ use App\Http\Requests\ValiRequest2;
80
92
 
81
93
  use App\Http\Requests\ValiRequest3;
82
94
 
95
+ use App\Models\LaravelContact;
96
+
83
97
  use Illuminate\Http\Request;
98
+
99
+ use Illuminate\Support\Facades\Auth;
100
+
101
+
102
+
103
+ class AdministratorController extends Controller
104
+
105
+
84
106
 
85
107
 
86
108