質問編集履歴

2

回答ありがとうございます!!やはり、bladeやControllerのどこかにエラーが発生しているということですね。コードを追記しましたので、アドバイスいただけると幸いです!

2020/07/25 23:27

投稿

Matsunosuke
Matsunosuke

スコア6

test CHANGED
File without changes
test CHANGED
@@ -18,594 +18,264 @@
18
18
 
19
19
 
20
20
 
21
- に加え、
21
+ というエラーが出ています。
22
-
23
-
24
-
25
- vendor/laravel/framework/src/Illuminate/Support/helpers.php:253
22
+
26
-
23
+
24
+
27
- helpers.phpのエラーが出ています。
25
+ 中でも、29行目にエラーがあると出ています。
28
-
29
- (253行目のhtmlspecialchars() の第一因数がおかしいと出ているのですが、$valueをどうすればいいのかわかりません。)
26
+
30
-
31
- *253行目以降は入りきらなかったため入れていません。
27
+
32
28
 
33
29
  ```php
34
30
 
35
- 50行目 if (is_numeric($value) || is_bool($value)) {
36
-
37
- return false;
38
-
39
- }
40
-
41
-
42
-
43
- if ($value instanceof Countable) {
44
-
45
- return count($value) === 0;
46
-
47
- }
48
-
49
-
50
-
51
- return empty($value);
31
+
32
+
33
+ login.blade.phpです
34
+
35
+
36
+
37
+ @extends('layouts.app')
38
+
39
+
40
+
41
+ @section('content')
42
+
43
+ <div class="container">
44
+
45
+ <div class="row justify-content-center">
46
+
47
+ <div class="col-md-8">
48
+
49
+ <div class="card">
50
+
51
+ <div class="card-header">{{ __('Login') }}</div>
52
+
53
+
54
+
55
+ <div class="card-body">
56
+
57
+ <form method="POST" action="{{ route('login') }}">
58
+
59
+ @csrf
60
+
61
+
62
+
63
+ <div class="form-group row">
64
+
65
+ <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
66
+
67
+
68
+
69
+ <div class="col-md-6">
70
+
71
+ <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
72
+
73
+
74
+
75
+ @error('email')
76
+
77
+ <span class="invalid-feedback" role="alert">
78
+
79
+ <strong>{{ $message }}</strong>
80
+
81
+ </span>
82
+
83
+ @enderror
84
+
85
+ </div>
86
+
87
+ </div>
88
+
89
+
90
+
91
+ <div class="form-group row">
92
+
93
+ 29行目 <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
94
+
95
+
96
+
97
+ <div class="col-md-6">
98
+
99
+ <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
100
+
101
+
102
+
103
+ @error('password')
104
+
105
+ <span class="invalid-feedback" role="alert">
106
+
107
+ <strong>{{ $message }}</strong>
108
+
109
+ </span>
110
+
111
+ @enderror
112
+
113
+ </div>
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <div class="form-group row">
120
+
121
+ <div class="col-md-6 offset-md-4">
122
+
123
+ <div class="form-check">
124
+
125
+ <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
126
+
127
+
128
+
129
+ <label class="form-check-label" for="remember">
130
+
131
+ {{ __('Remember Me') }}
132
+
133
+ </label>
134
+
135
+ </div>
136
+
137
+ </div>
138
+
139
+ </div>
140
+
141
+
142
+
143
+ <div class="form-group row mb-0">
144
+
145
+ <div class="col-md-8 offset-md-4">
146
+
147
+ <button type="submit" class="btn btn-primary">
148
+
149
+ {{ __('Login') }}
150
+
151
+ </button>
152
+
153
+
154
+
155
+ @if (Route::has('password.request'))
156
+
157
+ <a class="btn btn-link" href="{{ route('password.request') }}">
158
+
159
+ {{ __('Forgot Your Password?') }}
160
+
161
+ </a>
162
+
163
+ @endif
164
+
165
+ </div>
166
+
167
+ </div>
168
+
169
+ </form>
170
+
171
+ </div>
172
+
173
+ </div>
174
+
175
+ </div>
176
+
177
+ </div>
178
+
179
+ </div>
180
+
181
+ @endsection
182
+
183
+ ```
184
+
185
+
186
+
187
+
188
+
189
+ ```php
190
+
191
+
192
+
193
+ web.phpです
194
+
195
+ Route::get('/', function () {
196
+
197
+ return view('welcome');
198
+
199
+ });
200
+
201
+
202
+
203
+ Auth::routes();
204
+
205
+
206
+
207
+ Route::get('/home', 'HomeController@index')->name('home');
208
+
209
+ ```
210
+
211
+
212
+
213
+
214
+
215
+ ```php
216
+
217
+ HomeController.phpです
218
+
219
+ <?php
220
+
221
+
222
+
223
+ namespace App\Http\Controllers;
224
+
225
+
226
+
227
+ use Illuminate\Http\Request;
228
+
229
+
230
+
231
+ class HomeController extends Controller
232
+
233
+ {
234
+
235
+ /**
236
+
237
+ * Create a new controller instance.
238
+
239
+ *
240
+
241
+ * @return void
242
+
243
+ */
244
+
245
+ public function __construct()
246
+
247
+ {
248
+
249
+ $this->middleware('auth');
52
250
 
53
251
  }
54
252
 
253
+
254
+
255
+ /**
256
+
257
+ * Show the application dashboard.
258
+
259
+ *
260
+
261
+ * @return \Illuminate\Contracts\Support\Renderable
262
+
263
+ */
264
+
265
+ public function index()
266
+
267
+ {
268
+
269
+ return view('home');
270
+
271
+ }
272
+
55
273
  }
56
274
 
57
-
58
-
59
- if (! function_exists('class_basename')) {
60
-
61
- /**
62
-
63
- * Get the class "basename" of the given object / class.
64
-
65
- *
66
-
67
- * @param string|object $class
68
-
69
- * @return string
70
-
71
- */
72
-
73
- function class_basename($class)
74
-
75
- {
76
-
77
- $class = is_object($class) ? get_class($class) : $class;
78
-
79
-
80
-
81
- return basename(str_replace('\', '/', $class));
82
-
83
- }
84
-
85
- }
86
-
87
-
88
-
89
- if (! function_exists('class_uses_recursive')) {
90
-
91
- /**
92
-
93
- * Returns all traits used by a class, its parent classes and trait of their traits.
94
-
95
- *
96
-
97
- * @param object|string $class
98
-
99
- * @return array
100
-
101
- */
102
-
103
- function class_uses_recursive($class)
104
-
105
- {
106
-
107
- if (is_object($class)) {
108
-
109
- $class = get_class($class);
110
-
111
- }
112
-
113
-
114
-
115
- $results = [];
116
-
117
-
118
-
119
- foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
120
-
121
- $results += trait_uses_recursive($class);
122
-
123
- }
124
-
125
-
126
-
127
- return array_unique($results);
128
-
129
- }
130
-
131
- }
132
-
133
-
134
-
135
- 100行目 if (! function_exists('collect')) {
136
-
137
- /**
138
-
139
- * Create a collection from the given value.
140
-
141
- *
142
-
143
- * @param mixed $value
144
-
145
- * @return \Illuminate\Support\Collection
146
-
147
- */
148
-
149
- function collect($value = null)
150
-
151
- {
152
-
153
- return new Collection($value);
154
-
155
- }
156
-
157
- }
158
-
159
-
160
-
161
- if (! function_exists('data_fill')) {
162
-
163
- /**
164
-
165
- * Fill in data where it's missing.
166
-
167
- *
168
-
169
- * @param mixed $target
170
-
171
- * @param string|array $key
172
-
173
- * @param mixed $value
174
-
175
- * @return mixed
176
-
177
- */
178
-
179
- function data_fill(&$target, $key, $value)
180
-
181
- {
182
-
183
- return data_set($target, $key, $value, false);
184
-
185
- }
186
-
187
- }
188
-
189
-
190
-
191
- if (! function_exists('data_get')) {
192
-
193
- /**
194
-
195
- * Get an item from an array or object using "dot" notation.
196
-
197
- *
198
-
199
- * @param mixed $target
200
-
201
- * @param string|array|int $key
202
-
203
- * @param mixed $default
204
-
205
- * @return mixed
206
-
207
- */
208
-
209
- function data_get($target, $key, $default = null)
210
-
211
- {
212
-
213
- if (is_null($key)) {
214
-
215
- return $target;
216
-
217
- }
218
-
219
-
220
-
221
- $key = is_array($key) ? $key : explode('.', $key);
222
-
223
-
224
-
225
- while (! is_null($segment = array_shift($key))) {
226
-
227
- if ($segment === '*') {
228
-
229
- if ($target instanceof Collection) {
230
-
231
- $target = $target->all();
232
-
233
- } elseif (! is_array($target)) {
234
-
235
- return value($default);
236
-
237
- 150行目
238
-
239
- }
240
-
241
-
242
-
243
- $result = [];
244
-
245
-
246
-
247
- foreach ($target as $item) {
248
-
249
- $result[] = data_get($item, $key);
250
-
251
- }
252
-
253
-
254
-
255
- return in_array('*', $key) ? Arr::collapse($result) : $result;
256
-
257
- }
258
-
259
-
260
-
261
- if (Arr::accessible($target) && Arr::exists($target, $segment)) {
262
-
263
- $target = $target[$segment];
264
-
265
- } elseif (is_object($target) && isset($target->{$segment})) {
266
-
267
- $target = $target->{$segment};
268
-
269
- } else {
270
-
271
- return value($default);
272
-
273
- }
274
-
275
- }
276
-
277
-
278
-
279
- return $target;
280
-
281
- }
282
-
283
- }
284
-
285
-
286
-
287
- if (! function_exists('data_set')) {
288
-
289
- /**
290
-
291
- * Set an item on an array or object using dot notation.
292
-
293
- *
294
-
295
- * @param mixed $target
296
-
297
- * @param string|array $key
298
-
299
- * @param mixed $value
300
-
301
- * @param bool $overwrite
302
-
303
- * @return mixed
304
-
305
- */
306
-
307
- function data_set(&$target, $key, $value, $overwrite = true)
308
-
309
- {
310
-
311
- $segments = is_array($key) ? $key : explode('.', $key);
312
-
313
-
314
-
315
- if (($segment = array_shift($segments)) === '*') {
316
-
317
- if (! Arr::accessible($target)) {
318
-
319
- $target = [];
320
-
321
- }
322
-
323
-
324
-
325
- if ($segments) {
326
-
327
- foreach ($target as &$inner) {
328
-
329
- data_set($inner, $segments, $value, $overwrite);
330
-
331
- }
332
-
333
- } elseif ($overwrite) {
334
-
335
- foreach ($target as &$inner) {
336
-
337
- 200行目 $inner = $value;
338
-
339
- }
340
-
341
- }
342
-
343
- } elseif (Arr::accessible($target)) {
344
-
345
- if ($segments) {
346
-
347
- if (! Arr::exists($target, $segment)) {
348
-
349
- $target[$segment] = [];
350
-
351
- }
352
-
353
-
354
-
355
- data_set($target[$segment], $segments, $value, $overwrite);
356
-
357
- } elseif ($overwrite || ! Arr::exists($target, $segment)) {
358
-
359
- $target[$segment] = $value;
360
-
361
- }
362
-
363
- } elseif (is_object($target)) {
364
-
365
- if ($segments) {
366
-
367
- if (! isset($target->{$segment})) {
368
-
369
- $target->{$segment} = [];
370
-
371
- }
372
-
373
-
374
-
375
- data_set($target->{$segment}, $segments, $value, $overwrite);
376
-
377
- } elseif ($overwrite || ! isset($target->{$segment})) {
378
-
379
- $target->{$segment} = $value;
380
-
381
- }
382
-
383
- } else {
384
-
385
- $target = [];
386
-
387
-
388
-
389
- if ($segments) {
390
-
391
- data_set($target[$segment], $segments, $value, $overwrite);
392
-
393
- } elseif ($overwrite) {
394
-
395
- $target[$segment] = $value;
396
-
397
- }
398
-
399
- }
400
-
401
-
402
-
403
- return $target;
404
-
405
- }
406
-
407
- }
408
-
409
-
410
-
411
- if (! function_exists('e')) {
412
-
413
- /**
414
-
415
- * Encode HTML special characters in a string.
416
-
417
- *
418
-
419
- * @param \Illuminate\Contracts\Support\Htmlable|string $value
420
-
421
- * @param bool $doubleEncode
422
-
423
- * @return string
424
-
425
- */
426
-
427
- function e($value, $doubleEncode = true)
428
-
429
- {
430
-
431
-
432
-
433
-
434
-
435
- if ($value instanceof Htmlable) {
436
-
437
- return $value->toHtml();
438
-
439
- }
440
-
441
-      
442
-
443
- 253行目 return htmlspecialchars($value,ENT_QUOTES,'UTF-8',$doubleEncode);
444
-
445
- }
446
-
447
- }
448
-
449
275
  ```
450
276
 
451
277
 
452
278
 
453
279
 
454
280
 
455
- ```php
456
-
457
-
458
-
459
- 追記:login.blade.phpです
460
-
461
-
462
-
463
- @extends('layouts.app')
464
-
465
-
466
-
467
- @section('content')
468
-
469
- <div class="container">
470
-
471
- <div class="row justify-content-center">
472
-
473
- <div class="col-md-8">
474
-
475
- <div class="card">
476
-
477
- <div class="card-header">{{ __('Login') }}</div>
478
-
479
-
480
-
481
- <div class="card-body">
482
-
483
- <form method="POST" action="{{ route('login') }}">
484
-
485
- @csrf
486
-
487
-
488
-
489
- <div class="form-group row">
490
-
491
- <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
492
-
493
-
494
-
495
- <div class="col-md-6">
496
-
497
- <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
498
-
499
-
500
-
501
- @error('email')
502
-
503
- <span class="invalid-feedback" role="alert">
504
-
505
- <strong>{{ $message }}</strong>
506
-
507
- </span>
508
-
509
- @enderror
510
-
511
- </div>
512
-
513
- </div>
514
-
515
-
516
-
517
- <div class="form-group row">
518
-
519
- <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
520
-
521
-
522
-
523
- <div class="col-md-6">
524
-
525
- <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
526
-
527
-
528
-
529
- @error('password')
530
-
531
- <span class="invalid-feedback" role="alert">
532
-
533
- <strong>{{ $message }}</strong>
534
-
535
- </span>
536
-
537
- @enderror
538
-
539
- </div>
540
-
541
- </div>
542
-
543
-
544
-
545
- <div class="form-group row">
546
-
547
- <div class="col-md-6 offset-md-4">
548
-
549
- <div class="form-check">
550
-
551
- <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
552
-
553
-
554
-
555
- <label class="form-check-label" for="remember">
556
-
557
- {{ __('Remember Me') }}
558
-
559
- </label>
560
-
561
- </div>
562
-
563
- </div>
564
-
565
- </div>
566
-
567
-
568
-
569
- <div class="form-group row mb-0">
570
-
571
- <div class="col-md-8 offset-md-4">
572
-
573
- <button type="submit" class="btn btn-primary">
574
-
575
- {{ __('Login') }}
576
-
577
- </button>
578
-
579
-
580
-
581
- @if (Route::has('password.request'))
582
-
583
- <a class="btn btn-link" href="{{ route('password.request') }}">
584
-
585
- {{ __('Forgot Your Password?') }}
586
-
587
- </a>
588
-
589
- @endif
590
-
591
- </div>
592
-
593
- </div>
594
-
595
- </form>
596
-
597
- </div>
598
-
599
- </div>
600
-
601
- </div>
602
-
603
- </div>
604
-
605
- </div>
606
-
607
- @endsection
608
-
609
-
610
-
611
- ```どなたか、解決策を教えていただければ幸いです。
281
+ どなたか、解決策を教えていただければ幸いです。

1

blabeの方に問題があるということでしたので、追記しました。ご確認していただければ幸いです。*入りきらなかったのでhelper.phpの一部を省いています。

2020/07/25 23:27

投稿

Matsunosuke
Matsunosuke

スコア6

test CHANGED
File without changes
test CHANGED
@@ -32,502 +32,402 @@
32
32
 
33
33
  ```php
34
34
 
35
-
36
-
37
- 0行目 <?php
38
-
39
-
40
-
41
- use Illuminate\Contracts\Support\Htmlable;
35
+ 50行目 if (is_numeric($value) || is_bool($value)) {
42
-
36
+
43
- use Illuminate\Support\Arr;
37
+ return false;
38
+
44
-
39
+ }
40
+
41
+
42
+
45
- use Illuminate\Support\Collection;
43
+ if ($value instanceof Countable) {
44
+
46
-
45
+ return count($value) === 0;
46
+
47
+ }
48
+
49
+
50
+
47
- use Illuminate\Support\Env;
51
+ return empty($value);
48
-
49
- use Illuminate\Support\HigherOrderTapProxy;
52
+
50
-
51
- use Illuminate\Support\Optional;
53
+ }
54
+
52
-
55
+ }
53
-
54
-
56
+
57
+
58
+
55
- if (! function_exists('append_config')) {
59
+ if (! function_exists('class_basename')) {
56
60
 
57
61
  /**
58
62
 
59
- * Assign high numeric IDs to a config item to force appending.
63
+ * Get the class "basename" of the given object / class.
60
64
 
61
65
  *
62
66
 
63
- * @param array $array
67
+ * @param string|object $class
68
+
69
+ * @return string
70
+
71
+ */
72
+
73
+ function class_basename($class)
74
+
75
+ {
76
+
77
+ $class = is_object($class) ? get_class($class) : $class;
78
+
79
+
80
+
81
+ return basename(str_replace('\', '/', $class));
82
+
83
+ }
84
+
85
+ }
86
+
87
+
88
+
89
+ if (! function_exists('class_uses_recursive')) {
90
+
91
+ /**
92
+
93
+ * Returns all traits used by a class, its parent classes and trait of their traits.
94
+
95
+ *
96
+
97
+ * @param object|string $class
64
98
 
65
99
  * @return array
66
100
 
67
101
  */
68
102
 
69
- function append_config(array $array)
103
+ function class_uses_recursive($class)
70
104
 
71
105
  {
72
106
 
107
+ if (is_object($class)) {
108
+
109
+ $class = get_class($class);
110
+
111
+ }
112
+
113
+
114
+
73
- $start = 9999;
115
+ $results = [];
116
+
117
+
118
+
74
-
119
+ foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
120
+
75
-
121
+ $results += trait_uses_recursive($class);
122
+
76
-
123
+ }
124
+
125
+
126
+
127
+ return array_unique($results);
128
+
129
+ }
130
+
131
+ }
132
+
133
+
134
+
135
+ 100行目 if (! function_exists('collect')) {
136
+
137
+ /**
138
+
139
+ * Create a collection from the given value.
140
+
141
+ *
142
+
143
+ * @param mixed $value
144
+
145
+ * @return \Illuminate\Support\Collection
146
+
147
+ */
148
+
149
+ function collect($value = null)
150
+
151
+ {
152
+
153
+ return new Collection($value);
154
+
155
+ }
156
+
157
+ }
158
+
159
+
160
+
161
+ if (! function_exists('data_fill')) {
162
+
163
+ /**
164
+
165
+ * Fill in data where it's missing.
166
+
167
+ *
168
+
169
+ * @param mixed $target
170
+
171
+ * @param string|array $key
172
+
173
+ * @param mixed $value
174
+
175
+ * @return mixed
176
+
177
+ */
178
+
77
- foreach ($array as $key => $value) {
179
+ function data_fill(&$target, $key, $value)
180
+
78
-
181
+ {
182
+
183
+ return data_set($target, $key, $value, false);
184
+
185
+ }
186
+
187
+ }
188
+
189
+
190
+
191
+ if (! function_exists('data_get')) {
192
+
193
+ /**
194
+
195
+ * Get an item from an array or object using "dot" notation.
196
+
197
+ *
198
+
199
+ * @param mixed $target
200
+
201
+ * @param string|array|int $key
202
+
203
+ * @param mixed $default
204
+
205
+ * @return mixed
206
+
207
+ */
208
+
209
+ function data_get($target, $key, $default = null)
210
+
211
+ {
212
+
79
- if (is_numeric($key)) {
213
+ if (is_null($key)) {
214
+
80
-
215
+ return $target;
216
+
217
+ }
218
+
219
+
220
+
221
+ $key = is_array($key) ? $key : explode('.', $key);
222
+
223
+
224
+
225
+ while (! is_null($segment = array_shift($key))) {
226
+
227
+ if ($segment === '*') {
228
+
229
+ if ($target instanceof Collection) {
230
+
231
+ $target = $target->all();
232
+
233
+ } elseif (! is_array($target)) {
234
+
235
+ return value($default);
236
+
237
+ 150行目
238
+
239
+ }
240
+
241
+
242
+
81
- $start++;
243
+ $result = [];
244
+
245
+
246
+
82
-
247
+ foreach ($target as $item) {
83
-
84
-
248
+
85
- $array[$start] = Arr::pull($array, $key);
249
+ $result[] = data_get($item, $key);
250
+
251
+ }
252
+
253
+
254
+
255
+ return in_array('*', $key) ? Arr::collapse($result) : $result;
86
256
 
87
257
  }
88
258
 
259
+
260
+
261
+ if (Arr::accessible($target) && Arr::exists($target, $segment)) {
262
+
263
+ $target = $target[$segment];
264
+
265
+ } elseif (is_object($target) && isset($target->{$segment})) {
266
+
267
+ $target = $target->{$segment};
268
+
269
+ } else {
270
+
271
+ return value($default);
272
+
89
- }
273
+ }
90
-
91
-
92
-
93
- return $array;
274
+
94
-
95
- }
275
+ }
276
+
277
+
278
+
96
-
279
+ return $target;
280
+
97
- }
281
+ }
282
+
98
-
283
+ }
99
-
100
-
284
+
285
+
286
+
101
- if (! function_exists('blank')) {
287
+ if (! function_exists('data_set')) {
102
288
 
103
289
  /**
104
290
 
105
- * Determine if the given value is "blank".
291
+ * Set an item on an array or object using dot notation.
106
292
 
107
293
  *
108
294
 
295
+ * @param mixed $target
296
+
297
+ * @param string|array $key
298
+
109
299
  * @param mixed $value
110
300
 
301
+ * @param bool $overwrite
302
+
111
- * @return bool
303
+ * @return mixed
112
304
 
113
305
  */
114
306
 
115
- function blank($value)
307
+ function data_set(&$target, $key, $value, $overwrite = true)
116
308
 
117
309
  {
118
310
 
119
- if (is_null($value)) {
120
-
121
- return true;
122
-
123
- }
124
-
125
-
126
-
127
- if (is_string($value)) {
128
-
129
- return trim($value) === '';
130
-
131
- }
132
-
133
-
134
-
135
- 50行目 if (is_numeric($value) || is_bool($value)) {
136
-
137
- return false;
138
-
139
- }
140
-
141
-
142
-
143
- if ($value instanceof Countable) {
144
-
145
- return count($value) === 0;
146
-
147
- }
148
-
149
-
150
-
151
- return empty($value);
152
-
153
- }
154
-
155
- }
156
-
157
-
158
-
159
- if (! function_exists('class_basename')) {
311
+ $segments = is_array($key) ? $key : explode('.', $key);
312
+
313
+
314
+
315
+ if (($segment = array_shift($segments)) === '*') {
316
+
317
+ if (! Arr::accessible($target)) {
318
+
319
+ $target = [];
320
+
321
+ }
322
+
323
+
324
+
325
+ if ($segments) {
326
+
327
+ foreach ($target as &$inner) {
328
+
329
+ data_set($inner, $segments, $value, $overwrite);
330
+
331
+ }
332
+
333
+ } elseif ($overwrite) {
334
+
335
+ foreach ($target as &$inner) {
336
+
337
+ 200行目 $inner = $value;
338
+
339
+ }
340
+
341
+ }
342
+
343
+ } elseif (Arr::accessible($target)) {
344
+
345
+ if ($segments) {
346
+
347
+ if (! Arr::exists($target, $segment)) {
348
+
349
+ $target[$segment] = [];
350
+
351
+ }
352
+
353
+
354
+
355
+ data_set($target[$segment], $segments, $value, $overwrite);
356
+
357
+ } elseif ($overwrite || ! Arr::exists($target, $segment)) {
358
+
359
+ $target[$segment] = $value;
360
+
361
+ }
362
+
363
+ } elseif (is_object($target)) {
364
+
365
+ if ($segments) {
366
+
367
+ if (! isset($target->{$segment})) {
368
+
369
+ $target->{$segment} = [];
370
+
371
+ }
372
+
373
+
374
+
375
+ data_set($target->{$segment}, $segments, $value, $overwrite);
376
+
377
+ } elseif ($overwrite || ! isset($target->{$segment})) {
378
+
379
+ $target->{$segment} = $value;
380
+
381
+ }
382
+
383
+ } else {
384
+
385
+ $target = [];
386
+
387
+
388
+
389
+ if ($segments) {
390
+
391
+ data_set($target[$segment], $segments, $value, $overwrite);
392
+
393
+ } elseif ($overwrite) {
394
+
395
+ $target[$segment] = $value;
396
+
397
+ }
398
+
399
+ }
400
+
401
+
402
+
403
+ return $target;
404
+
405
+ }
406
+
407
+ }
408
+
409
+
410
+
411
+ if (! function_exists('e')) {
160
412
 
161
413
  /**
162
414
 
163
- * Get the class "basename" of the given object / class.
415
+ * Encode HTML special characters in a string.
164
416
 
165
417
  *
166
418
 
419
+ * @param \Illuminate\Contracts\Support\Htmlable|string $value
420
+
167
- * @param string|object $class
421
+ * @param bool $doubleEncode
168
422
 
169
423
  * @return string
170
424
 
171
425
  */
172
426
 
173
- function class_basename($class)
427
+ function e($value, $doubleEncode = true)
174
428
 
175
429
  {
176
430
 
177
- $class = is_object($class) ? get_class($class) : $class;
178
-
179
-
180
-
181
- return basename(str_replace('\', '/', $class));
182
-
183
- }
184
-
185
- }
186
-
187
-
188
-
189
- if (! function_exists('class_uses_recursive')) {
190
-
191
- /**
192
-
193
- * Returns all traits used by a class, its parent classes and trait of their traits.
194
-
195
- *
196
-
197
- * @param object|string $class
198
-
199
- * @return array
200
-
201
- */
202
-
203
- function class_uses_recursive($class)
204
-
205
- {
206
-
207
- if (is_object($class)) {
208
-
209
- $class = get_class($class);
210
-
211
- }
212
-
213
-
214
-
215
- $results = [];
216
-
217
-
218
-
219
- foreach (array_reverse(class_parents($class)) + [$class => $class] as $class) {
220
-
221
- $results += trait_uses_recursive($class);
222
-
223
- }
224
-
225
-
226
-
227
- return array_unique($results);
228
-
229
- }
230
-
231
- }
232
-
233
-
234
-
235
- 100行目 if (! function_exists('collect')) {
236
-
237
- /**
238
-
239
- * Create a collection from the given value.
240
-
241
- *
242
-
243
- * @param mixed $value
244
-
245
- * @return \Illuminate\Support\Collection
246
-
247
- */
248
-
249
- function collect($value = null)
250
-
251
- {
252
-
253
- return new Collection($value);
254
-
255
- }
256
-
257
- }
258
-
259
-
260
-
261
- if (! function_exists('data_fill')) {
262
-
263
- /**
264
-
265
- * Fill in data where it's missing.
266
-
267
- *
268
-
269
- * @param mixed $target
270
-
271
- * @param string|array $key
272
-
273
- * @param mixed $value
274
-
275
- * @return mixed
276
-
277
- */
278
-
279
- function data_fill(&$target, $key, $value)
280
-
281
- {
282
-
283
- return data_set($target, $key, $value, false);
284
-
285
- }
286
-
287
- }
288
-
289
-
290
-
291
- if (! function_exists('data_get')) {
292
-
293
- /**
294
-
295
- * Get an item from an array or object using "dot" notation.
296
-
297
- *
298
-
299
- * @param mixed $target
300
-
301
- * @param string|array|int $key
302
-
303
- * @param mixed $default
304
-
305
- * @return mixed
306
-
307
- */
308
-
309
- function data_get($target, $key, $default = null)
310
-
311
- {
312
-
313
- if (is_null($key)) {
314
-
315
- return $target;
316
-
317
- }
318
-
319
-
320
-
321
- $key = is_array($key) ? $key : explode('.', $key);
322
-
323
-
324
-
325
- while (! is_null($segment = array_shift($key))) {
326
-
327
- if ($segment === '*') {
328
-
329
- if ($target instanceof Collection) {
330
-
331
- $target = $target->all();
332
-
333
- } elseif (! is_array($target)) {
334
-
335
- return value($default);
336
-
337
- 150行目
338
-
339
- }
340
-
341
-
342
-
343
- $result = [];
344
-
345
-
346
-
347
- foreach ($target as $item) {
348
-
349
- $result[] = data_get($item, $key);
350
-
351
- }
352
-
353
-
354
-
355
- return in_array('*', $key) ? Arr::collapse($result) : $result;
356
-
357
- }
358
-
359
-
360
-
361
- if (Arr::accessible($target) && Arr::exists($target, $segment)) {
362
-
363
- $target = $target[$segment];
364
-
365
- } elseif (is_object($target) && isset($target->{$segment})) {
366
-
367
- $target = $target->{$segment};
368
-
369
- } else {
370
-
371
- return value($default);
372
-
373
- }
374
-
375
- }
376
-
377
-
378
-
379
- return $target;
380
-
381
- }
382
-
383
- }
384
-
385
-
386
-
387
- if (! function_exists('data_set')) {
388
-
389
- /**
390
-
391
- * Set an item on an array or object using dot notation.
392
-
393
- *
394
-
395
- * @param mixed $target
396
-
397
- * @param string|array $key
398
-
399
- * @param mixed $value
400
-
401
- * @param bool $overwrite
402
-
403
- * @return mixed
404
-
405
- */
406
-
407
- function data_set(&$target, $key, $value, $overwrite = true)
408
-
409
- {
410
-
411
- $segments = is_array($key) ? $key : explode('.', $key);
412
-
413
-
414
-
415
- if (($segment = array_shift($segments)) === '*') {
416
-
417
- if (! Arr::accessible($target)) {
418
-
419
- $target = [];
420
-
421
- }
422
-
423
-
424
-
425
- if ($segments) {
426
-
427
- foreach ($target as &$inner) {
428
-
429
- data_set($inner, $segments, $value, $overwrite);
430
-
431
- }
432
-
433
- } elseif ($overwrite) {
434
-
435
- foreach ($target as &$inner) {
436
-
437
- 200行目 $inner = $value;
438
-
439
- }
440
-
441
- }
442
-
443
- } elseif (Arr::accessible($target)) {
444
-
445
- if ($segments) {
446
-
447
- if (! Arr::exists($target, $segment)) {
448
-
449
- $target[$segment] = [];
450
-
451
- }
452
-
453
-
454
-
455
- data_set($target[$segment], $segments, $value, $overwrite);
456
-
457
- } elseif ($overwrite || ! Arr::exists($target, $segment)) {
458
-
459
- $target[$segment] = $value;
460
-
461
- }
462
-
463
- } elseif (is_object($target)) {
464
-
465
- if ($segments) {
466
-
467
- if (! isset($target->{$segment})) {
468
-
469
- $target->{$segment} = [];
470
-
471
- }
472
-
473
-
474
-
475
- data_set($target->{$segment}, $segments, $value, $overwrite);
476
-
477
- } elseif ($overwrite || ! isset($target->{$segment})) {
478
-
479
- $target->{$segment} = $value;
480
-
481
- }
482
-
483
- } else {
484
-
485
- $target = [];
486
-
487
-
488
-
489
- if ($segments) {
490
-
491
- data_set($target[$segment], $segments, $value, $overwrite);
492
-
493
- } elseif ($overwrite) {
494
-
495
- $target[$segment] = $value;
496
-
497
- }
498
-
499
- }
500
-
501
-
502
-
503
- return $target;
504
-
505
- }
506
-
507
- }
508
-
509
-
510
-
511
- if (! function_exists('e')) {
512
-
513
- /**
514
-
515
- * Encode HTML special characters in a string.
516
-
517
- *
518
-
519
- * @param \Illuminate\Contracts\Support\Htmlable|string $value
520
-
521
- * @param bool $doubleEncode
522
-
523
- * @return string
524
-
525
- */
526
-
527
- function e($value, $doubleEncode = true)
528
-
529
- {
530
-
531
431
 
532
432
 
533
433
 
@@ -546,7 +446,165 @@
546
446
 
547
447
  }
548
448
 
549
-
449
+ ```
450
+
451
+
452
+
453
+
454
+
455
+ ```php
456
+
457
+
458
+
459
+ 追記:login.blade.phpです
460
+
461
+
462
+
463
+ @extends('layouts.app')
464
+
465
+
466
+
467
+ @section('content')
468
+
469
+ <div class="container">
470
+
471
+ <div class="row justify-content-center">
472
+
473
+ <div class="col-md-8">
474
+
475
+ <div class="card">
476
+
477
+ <div class="card-header">{{ __('Login') }}</div>
478
+
479
+
480
+
481
+ <div class="card-body">
482
+
483
+ <form method="POST" action="{{ route('login') }}">
484
+
485
+ @csrf
486
+
487
+
488
+
489
+ <div class="form-group row">
490
+
491
+ <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
492
+
493
+
494
+
495
+ <div class="col-md-6">
496
+
497
+ <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
498
+
499
+
500
+
501
+ @error('email')
502
+
503
+ <span class="invalid-feedback" role="alert">
504
+
505
+ <strong>{{ $message }}</strong>
506
+
507
+ </span>
508
+
509
+ @enderror
510
+
511
+ </div>
512
+
513
+ </div>
514
+
515
+
516
+
517
+ <div class="form-group row">
518
+
519
+ <label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
520
+
521
+
522
+
523
+ <div class="col-md-6">
524
+
525
+ <input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
526
+
527
+
528
+
529
+ @error('password')
530
+
531
+ <span class="invalid-feedback" role="alert">
532
+
533
+ <strong>{{ $message }}</strong>
534
+
535
+ </span>
536
+
537
+ @enderror
538
+
539
+ </div>
540
+
541
+ </div>
542
+
543
+
544
+
545
+ <div class="form-group row">
546
+
547
+ <div class="col-md-6 offset-md-4">
548
+
549
+ <div class="form-check">
550
+
551
+ <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
552
+
553
+
554
+
555
+ <label class="form-check-label" for="remember">
556
+
557
+ {{ __('Remember Me') }}
558
+
559
+ </label>
560
+
561
+ </div>
562
+
563
+ </div>
564
+
565
+ </div>
566
+
567
+
568
+
569
+ <div class="form-group row mb-0">
570
+
571
+ <div class="col-md-8 offset-md-4">
572
+
573
+ <button type="submit" class="btn btn-primary">
574
+
575
+ {{ __('Login') }}
576
+
577
+ </button>
578
+
579
+
580
+
581
+ @if (Route::has('password.request'))
582
+
583
+ <a class="btn btn-link" href="{{ route('password.request') }}">
584
+
585
+ {{ __('Forgot Your Password?') }}
586
+
587
+ </a>
588
+
589
+ @endif
590
+
591
+ </div>
592
+
593
+ </div>
594
+
595
+ </form>
596
+
597
+ </div>
598
+
599
+ </div>
600
+
601
+ </div>
602
+
603
+ </div>
604
+
605
+ </div>
606
+
607
+ @endsection
550
608
 
551
609
 
552
610