質問編集履歴
1
前職の社外秘の内容が含まれていたため、可能であれば投稿を削除してほしいです。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,154 +1,4 @@
|
|
1
1
|
## テーマ、知りたいこと
|
2
|
-
Laravel Breezeを使用した会員登録がし
|
2
|
+
Laravel Breezeを使用した会員登録がし
|
3
3
|
|
4
|
-
|
5
|
-
## 背景、状況
|
6
|
-
現在自作アプリを作成しており、Laravel Breezeを使用したログイン認証機能の実装に取り掛かっています。
|
7
|
-
会員登録画面やログイン画面を自身でカスタマイズして(register.blade.php内でinputタグを追加)会員登録しようとしたところ、fullnameのフォームに入力しているのですが、"The name field is required."というバリデーションエラーが表示されてしまう。
|
8
|
-
|
9
|
-
## 自身で解決に向けて行ったこと
|
10
|
-
Laravel.logファイルを確認したり、bladeファイル内やModelファイル内の入力が正しいかなど確認してみたが解決できませんでした。
|
11
|
-
|
12
|
-
|
13
|
-
下記にそれぞれのファイルのコードを記載させていただきます。(文字数がオーバーしてしまうため、Laravel.log内のコードは最初の行のみ記載しております)
|
14
|
-
また、Laravel.log内の1行目末尾にてconection.php:501と吐き出されていますが、
|
15
|
-
下記に載せたconection.phpの17行目が私のVSコード内では501行目にあたります。
|
16
|
-
|
17
|
-
```register.blade.php
|
18
|
-
<x-guest-layout>
|
19
|
-
<x-auth-card>
|
20
|
-
<x-slot name="logo">
|
21
|
-
<a href="/">
|
22
|
-
<x-application-logo class="w-20 h-20 fill-current text-gray-500" />
|
23
|
-
</a>
|
24
|
-
</x-slot>
|
25
|
-
|
26
|
-
<!-- Validation Errors -->
|
27
|
-
<x-auth-validation-errors class="mb-4" :errors="$errors" />
|
28
|
-
|
29
|
-
<form method="POST" action="{{ route('register') }}">
|
30
|
-
@csrf
|
31
|
-
|
32
|
-
<!-- role_id -->
|
33
|
-
<div>
|
34
|
-
<x-input id="role_id" class="block mt-1 w-full" type="hidden" name="role_id" :value="old('role_id')" required autofocus />
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<!-- fullName -->
|
38
|
-
<div>
|
39
|
-
<x-label for="fullname" :value="__('fullname')" />
|
40
|
-
|
41
|
-
<x-input id="fullname" class="block mt-1 w-full" type="text" name="fullname" :value="old('fullname')" required autofocus />
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<!-- birthday -->
|
45
|
-
<div>
|
46
|
-
<x-label for="birthday" :value="__('birthday')" />
|
47
|
-
|
48
|
-
<x-input id="birthday" class="block mt-1 w-full" type="text" name="birthday" :value="old('birthday')" required autofocus />
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<!-- address -->
|
52
|
-
<div class="mt-4">
|
53
|
-
<x-label for="address" :value="__('address')" />
|
54
|
-
|
55
|
-
<x-input id="address" class="block mt-1 w-full" type="text" name="address" :value="old('address')" required />
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<!-- Email-->
|
59
|
-
<div class="mt-4">
|
60
|
-
<x-label for="email" :value="__('Email')" />
|
61
|
-
|
62
|
-
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<!-- tel-->
|
66
|
-
<div class="mt-4">
|
67
|
-
<x-label for="tel" :value="__('tel')" />
|
68
|
-
|
69
|
-
<x-input id="tel" class="block mt-1 w-full" type="text" name="tel" :value="old('tel')" required />
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<!-- Password -->
|
73
|
-
<div class="mt-4">
|
74
|
-
<x-label for="password" :value="__('Password')" />
|
75
|
-
|
76
|
-
<x-input id="password" class="block mt-1 w-full"
|
77
|
-
type="password"
|
78
|
-
name="password"
|
79
|
-
required autocomplete="new-password" />
|
80
|
-
</div>
|
81
|
-
|
82
|
-
<!-- Confirm Password -->
|
83
|
-
<div class="mt-4">
|
84
|
-
<x-label for="password_confirmation" :value="__('Confirm Password')" />
|
85
|
-
|
86
|
-
<x-input id="password_confirmation" class="block mt-1 w-full"
|
87
|
-
type="password"
|
88
|
-
name="password_confirmation" required />
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<div class="flex items-center justify-end mt-4">
|
92
|
-
<a class="underline text-sm text-gray-600 hover:text-gray-900" href="{{ route('login') }}">
|
93
|
-
{{ __('Already registered?') }}
|
94
|
-
</a>
|
95
|
-
|
96
|
-
<x-button class="ml-4">
|
97
|
-
{{ __('Register') }}
|
98
|
-
</x-button>
|
99
|
-
</div>
|
100
|
-
</form>
|
101
|
-
</x-auth-card>
|
102
|
-
</x-guest-layout>
|
103
|
-
|
104
|
-
```
|
105
|
-
|
106
|
-
|
107
|
-
```Laravel.log
|
108
|
-
[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1364 Field 'fullname' doesn't have a default value at /var/www/workspace/RentaBoard/vendor/laravel/framework/src/Illuminate/Database/Connection.php:501)
|
109
|
-
[stacktrace]
|
110
|
-
```
|
111
|
-
|
112
|
-
```conection.php
|
113
|
-
/**
|
114
|
-
* Execute an SQL statement and return the boolean result.
|
115
|
-
*
|
116
|
-
* @param string $query
|
117
|
-
* @param array $bindings
|
118
|
-
* @return bool
|
119
|
-
*/
|
120
|
-
public function statement($query, $bindings = [])
|
121
|
-
{
|
122
|
-
return $this->run($query, $bindings, function ($query, $bindings) {
|
123
|
-
if ($this->pretending()) {
|
124
|
-
return true;
|
125
|
-
}
|
126
|
-
|
127
|
-
$statement = $this->getPdo()->prepare($query);
|
128
|
-
|
129
|
-
$this->bindValues($statement, $this->prepareBindings($bindings));
|
130
|
-
|
131
|
-
$this->recordsHaveBeenModified();
|
132
|
-
|
133
|
-
return $statement->execute();
|
134
|
-
});
|
135
|
-
}
|
136
|
-
```
|
137
|
-
|
138
|
-
## 環境について
|
139
|
-
環境に関しては下記の通りです。
|
140
|
-
|
141
|
-
開発環境はDockerです。
|
142
|
-
Docker内のコンテナは以下の通りです。
|
143
|
-
PHP7.4
|
144
|
-
MySQL5.7
|
145
|
-
nginx
|
146
|
-
|
147
|
-
FWはLaravel8です。
|
148
|
-
|
149
|
-
どうかよろしくお願いいたします!
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
4
|
+
削除願います
|