質問編集履歴
2
コード
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,3 +23,581 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
クッキーを使用することが正解かどうかは分かりませんが自分で進めてみたいと思います。
|
26
|
+
|
27
|
+
> web.php
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
Route::get('Login', 'UserController@Login')->name('Login');
|
32
|
+
|
33
|
+
Route::get('Signup', 'UserController@Signup')->name('Signup');
|
34
|
+
|
35
|
+
Route::get('Home', 'UserController@Home')->name('Home');
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
> UserController.php
|
42
|
+
|
43
|
+
```
|
44
|
+
|
45
|
+
namespace App\Http\Controllers;
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
use Illuminate\Http\Request;
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
class UserController extends Controller
|
54
|
+
|
55
|
+
{
|
56
|
+
|
57
|
+
public function Login()
|
58
|
+
|
59
|
+
{
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
return view('Lessons.Login');
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
public function Signup()
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
return view('Lessons.Signup');
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
public function Home()
|
78
|
+
|
79
|
+
{
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
return view('Lessons.Home');
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
```
|
90
|
+
|
91
|
+
> Home.blade.php
|
92
|
+
|
93
|
+
```
|
94
|
+
|
95
|
+
<!DOCTYPE html>
|
96
|
+
|
97
|
+
<html lang="ja">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
<head>
|
102
|
+
|
103
|
+
<meta charset="utf-8">
|
104
|
+
|
105
|
+
<title>home</title>
|
106
|
+
|
107
|
+
<link rel="stylesheet" type="text/css" href="login.css" media="all" />
|
108
|
+
|
109
|
+
<style>
|
110
|
+
|
111
|
+
.top-username {
|
112
|
+
|
113
|
+
position: absolute;
|
114
|
+
|
115
|
+
right: 120px;
|
116
|
+
|
117
|
+
top: 18px;
|
118
|
+
|
119
|
+
color: lightcoral;
|
120
|
+
|
121
|
+
text-decoration: none;
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
.top-logout {
|
128
|
+
|
129
|
+
position: absolute;
|
130
|
+
|
131
|
+
right: 30px;
|
132
|
+
|
133
|
+
top: 18px;
|
134
|
+
|
135
|
+
color: lightcoral;
|
136
|
+
|
137
|
+
text-decoration: none;
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
#form {
|
144
|
+
|
145
|
+
background: #053352;
|
146
|
+
|
147
|
+
background-image: -webkit-linear-gradient(top, #053352, Courier New);
|
148
|
+
|
149
|
+
background-image: -moz-linear-gradient(top, #053352, Courier New);
|
150
|
+
|
151
|
+
background-image: -ms-linear-gradient(top, #053352, Courier New);
|
152
|
+
|
153
|
+
background-image: -o-linear-gradient(top, #053352, Courier New);
|
154
|
+
|
155
|
+
background-image: linear-gradient(to bottom, #053352, Courier New);
|
156
|
+
|
157
|
+
-webkit-border-radius: 6;
|
158
|
+
|
159
|
+
-moz-border-radius: 6;
|
160
|
+
|
161
|
+
border-radius: 6px;
|
162
|
+
|
163
|
+
font-family: Courier New;
|
164
|
+
|
165
|
+
color: #ffffff;
|
166
|
+
|
167
|
+
font-size: 30px;
|
168
|
+
|
169
|
+
padding: 20px 20px 20px 20px;
|
170
|
+
|
171
|
+
text-decoration: none;
|
172
|
+
|
173
|
+
text-align: center;
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
</style>
|
178
|
+
|
179
|
+
</head>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<body>
|
184
|
+
|
185
|
+
<p><a class="top-username" href={{ route('Home')}}>Username</a></p>
|
186
|
+
|
187
|
+
<p><a class="top-logout" href={{ route('Login')}}>Logout</a></p>
|
188
|
+
|
189
|
+
<br>
|
190
|
+
|
191
|
+
<br>
|
192
|
+
|
193
|
+
<br>
|
194
|
+
|
195
|
+
<br>
|
196
|
+
|
197
|
+
<br>
|
198
|
+
|
199
|
+
<br>
|
200
|
+
|
201
|
+
<div id="form">
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<p>Welcome!Your Home!</p>
|
206
|
+
|
207
|
+
<form method="POST" action="/Home">
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</form>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</body>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
</html>
|
220
|
+
|
221
|
+
```
|
222
|
+
|
223
|
+
> Signup.blade.php
|
224
|
+
|
225
|
+
```
|
226
|
+
|
227
|
+
@extends('layouts.Loginapp')
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
@section('title')
|
232
|
+
|
233
|
+
SignUp
|
234
|
+
|
235
|
+
@endsection
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
@section('form')
|
240
|
+
|
241
|
+
<p>Name</p>
|
242
|
+
|
243
|
+
<p class="name"><input type="text" name="name" maxlength="32" autocomplete="OFF" /></p>
|
244
|
+
|
245
|
+
<p>Mailaddress</p>
|
246
|
+
|
247
|
+
<p class="mailaddress"><input type="text" name="mailaddress" maxlength="32" autocomplete="OFF" /></p>
|
248
|
+
|
249
|
+
<p>Password</p>
|
250
|
+
|
251
|
+
<p class="password"><input type="password" name="password" maxlength="32" autocomplete="OFF" /></p>
|
252
|
+
|
253
|
+
<p>Confirm Password</p>
|
254
|
+
|
255
|
+
<p class="Confirm password"><input type="password" name="Confirm password" maxlength="32" autocomplete="OFF" /></p>
|
256
|
+
|
257
|
+
<p class="submit"><input type="submit" value="登録" class="top-username" href={{ route('Home')}}></p>
|
258
|
+
|
259
|
+
@endsection
|
260
|
+
|
261
|
+
```
|
262
|
+
|
263
|
+
> Loginapp.blade.php
|
264
|
+
|
265
|
+
```
|
266
|
+
|
267
|
+
<!DOCTYPE html>
|
268
|
+
|
269
|
+
<html lang="ja">
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
<head>
|
274
|
+
|
275
|
+
<meta charset="utf-8">
|
276
|
+
|
277
|
+
<title>@yield('title')</title>
|
278
|
+
|
279
|
+
<link rel="stylesheet" type="text/css" href="login.css" media="all" />
|
280
|
+
|
281
|
+
<style>
|
282
|
+
|
283
|
+
body,
|
284
|
+
|
285
|
+
p,
|
286
|
+
|
287
|
+
form,
|
288
|
+
|
289
|
+
input {
|
290
|
+
|
291
|
+
margin: 0
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
.top-login {
|
300
|
+
|
301
|
+
position: absolute;
|
302
|
+
|
303
|
+
right: 120px;
|
304
|
+
|
305
|
+
top: 18px;
|
306
|
+
|
307
|
+
color: lightcoral;
|
308
|
+
|
309
|
+
text-decoration: none;
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
.top-signup {
|
316
|
+
|
317
|
+
position: absolute;
|
318
|
+
|
319
|
+
right: 30px;
|
320
|
+
|
321
|
+
top: 18px;
|
322
|
+
|
323
|
+
color: lightcoral;
|
324
|
+
|
325
|
+
text-decoration: none;
|
326
|
+
|
327
|
+
}
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
#form {
|
332
|
+
|
333
|
+
width: 350px;
|
334
|
+
|
335
|
+
margin: 30px auto;
|
336
|
+
|
337
|
+
padding: 20px;
|
338
|
+
|
339
|
+
border: 1px solid #555;
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
form p {
|
346
|
+
|
347
|
+
font-size: 14px;
|
348
|
+
|
349
|
+
}
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
.form-title {
|
354
|
+
|
355
|
+
font-size: 30px;
|
356
|
+
|
357
|
+
text-align: center;
|
358
|
+
|
359
|
+
margin-bottom: 20px;
|
360
|
+
|
361
|
+
border-bottom: solid 3px #fff;
|
362
|
+
|
363
|
+
"
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
}
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
.name {
|
372
|
+
|
373
|
+
margin-bottom: 20px;
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
.mailaddress {
|
380
|
+
|
381
|
+
margin-bottom: 20px;
|
382
|
+
|
383
|
+
}
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
.password {
|
388
|
+
|
389
|
+
margin-bottom: 20px;
|
390
|
+
|
391
|
+
}
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
.confirm password {
|
398
|
+
|
399
|
+
margin-bottom: 20px;
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
input[type="text"],
|
406
|
+
|
407
|
+
input[type="password"] {
|
408
|
+
|
409
|
+
width: 350px;
|
410
|
+
|
411
|
+
padding: 4px;
|
412
|
+
|
413
|
+
font-size: 14px;
|
414
|
+
|
415
|
+
margin: 0 auto;
|
416
|
+
|
417
|
+
}
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
.submit {
|
422
|
+
|
423
|
+
text-align: center;
|
424
|
+
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
/* skin */
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
#form {
|
434
|
+
|
435
|
+
background: #053352;
|
436
|
+
|
437
|
+
background-image: -webkit-linear-gradient(top, #053352, Courier New);
|
438
|
+
|
439
|
+
background-image: -moz-linear-gradient(top, #053352, Courier New);
|
440
|
+
|
441
|
+
background-image: -ms-linear-gradient(top, #053352, Courier New);
|
442
|
+
|
443
|
+
background-image: -o-linear-gradient(top, #053352, Courier New);
|
444
|
+
|
445
|
+
background-image: linear-gradient(to bottom, #053352, Courier New);
|
446
|
+
|
447
|
+
-webkit-border-radius: 6;
|
448
|
+
|
449
|
+
-moz-border-radius: 6;
|
450
|
+
|
451
|
+
border-radius: 6px;
|
452
|
+
|
453
|
+
font-family: Courier New;
|
454
|
+
|
455
|
+
color: #ffffff;
|
456
|
+
|
457
|
+
font-size: 20px;
|
458
|
+
|
459
|
+
padding: 20px 20px 20px 20px;
|
460
|
+
|
461
|
+
text-decoration: none;
|
462
|
+
|
463
|
+
}
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
.submit input {
|
468
|
+
|
469
|
+
background: #f78181;
|
470
|
+
|
471
|
+
background-image: -webkit-linear-gradient(top, #f78181, #f78181);
|
472
|
+
|
473
|
+
background-image: -moz-linear-gradient(top, #f78181, #f78181);
|
474
|
+
|
475
|
+
background-image: -ms-linear-gradient(top, #f78181, #f78181);
|
476
|
+
|
477
|
+
background-image: -o-linear-gradient(top, #f78181, #f78181);
|
478
|
+
|
479
|
+
background-image: linear-gradient(to bottom, #f78181, #f78181);
|
480
|
+
|
481
|
+
-webkit-border-radius: 8;
|
482
|
+
|
483
|
+
-moz-border-radius: 8;
|
484
|
+
|
485
|
+
border-radius: 8px;
|
486
|
+
|
487
|
+
-webkit-box-shadow: 1px 1px 3px #666666;
|
488
|
+
|
489
|
+
-moz-box-shadow: 1px 1px 3px #666666;
|
490
|
+
|
491
|
+
box-shadow: 1px 1px 3px #666666;
|
492
|
+
|
493
|
+
font-family: Courier New;
|
494
|
+
|
495
|
+
color: #ffffff;
|
496
|
+
|
497
|
+
font-size: 16px;
|
498
|
+
|
499
|
+
padding: 10px 20px 10px 20px;
|
500
|
+
|
501
|
+
text-decoration: none;
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
.submit input:hover {
|
508
|
+
|
509
|
+
background: #f5c7c7;
|
510
|
+
|
511
|
+
background-image: -webkit-linear-gradient(top, #f5c7c7, #f5c7c7);
|
512
|
+
|
513
|
+
background-image: -moz-linear-gradient(top, #f5c7c7, #f5c7c7);
|
514
|
+
|
515
|
+
background-image: -ms-linear-gradient(top, #f5c7c7, #f5c7c7);
|
516
|
+
|
517
|
+
background-image: -o-linear-gradient(top, #f5c7c7, #f5c7c7);
|
518
|
+
|
519
|
+
background-image: linear-gradient(to bottom, #f5c7c7, #f5c7c7);
|
520
|
+
|
521
|
+
text-decoration: none;
|
522
|
+
|
523
|
+
}
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
#form {
|
528
|
+
|
529
|
+
background: #053352;
|
530
|
+
|
531
|
+
background-image: -webkit-linear-gradient(top, #053352, Courier New);
|
532
|
+
|
533
|
+
background-image: -moz-linear-gradient(top, #053352, Courier New);
|
534
|
+
|
535
|
+
background-image: -ms-linear-gradient(top, #053352, Courier New);
|
536
|
+
|
537
|
+
background-image: -o-linear-gradient(top, #053352, Courier New);
|
538
|
+
|
539
|
+
background-image: linear-gradient(to bottom, #053352, Courier New);
|
540
|
+
|
541
|
+
-webkit-border-radius: 6;
|
542
|
+
|
543
|
+
-moz-border-radius: 6;
|
544
|
+
|
545
|
+
border-radius: 6px;
|
546
|
+
|
547
|
+
font-family: Courier New;
|
548
|
+
|
549
|
+
color: #ffffff;
|
550
|
+
|
551
|
+
font-size: 20px;
|
552
|
+
|
553
|
+
padding: 20px 20px 20px 20px;
|
554
|
+
|
555
|
+
text-decoration: none;
|
556
|
+
|
557
|
+
}
|
558
|
+
|
559
|
+
</style>
|
560
|
+
|
561
|
+
</head>
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
<body>
|
566
|
+
|
567
|
+
<p><a class="top-login" href={{ route('Login')}}>Login</a></p>
|
568
|
+
|
569
|
+
<p><a class="top-signup" href={{ route('Signup')}}>Sign up</a></p>
|
570
|
+
|
571
|
+
<br>
|
572
|
+
|
573
|
+
<br>
|
574
|
+
|
575
|
+
<br>
|
576
|
+
|
577
|
+
<br>
|
578
|
+
|
579
|
+
<br>
|
580
|
+
|
581
|
+
<br>
|
582
|
+
|
583
|
+
<div id="form">
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
<p>@yield('title')</p>
|
588
|
+
|
589
|
+
<form method="GET" action="/Home">
|
590
|
+
|
591
|
+
@yield('form')
|
592
|
+
|
593
|
+
</form>
|
594
|
+
|
595
|
+
</div>
|
596
|
+
|
597
|
+
</body>
|
598
|
+
|
599
|
+
|
600
|
+
|
601
|
+
</html>
|
602
|
+
|
603
|
+
```
|
1
何がしたいのか。何に困っているのか。
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,3 +3,23 @@
|
|
3
3
|
具体的な方法が思いつきません。。。
|
4
4
|
|
5
5
|
どなたかご教示頂けないでしょうか?
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
※追記
|
10
|
+
|
11
|
+
「ユーザー新規登録ページ」の名前フォームに入力された値を「ホームページ」で取得したいと考えました。
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
ミドルウェアを使用してどのようにデータを保管、取得すれば良いのかが分かりませんでした。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
そもそもミドルウェアを使用するだけでは実装出来ずクッキーを使用して実装する
|
20
|
+
|
21
|
+
↑ここまできました。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
クッキーを使用することが正解かどうかは分かりませんが自分で進めてみたいと思います。
|