Skip to content

Commit b290777

Browse files
committed
Added account info page
1 parent 4a060b4 commit b290777

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
<img src="https://user-images.githubusercontent.com/6037466/184547433-25f6a5a6-4e53-4448-948a-82f18a58d84c.png">
4242
<br/><br/>
4343
<img src="https://user-images.githubusercontent.com/6037466/184547446-d482df44-0835-4a37-8482-83d5279269fb.png">
44+
<br/><br/>
45+
<img src="https://user-images.githubusercontent.com/6037466/184570672-6413384d-a5c4-461b-9c8e-d97ede29a21f.png">
4446
</p>
4547

4648
## License

app/Http/Controllers/Admin/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function accountInfo()
175175
*/
176176
public function accountInfoStore(Request $request)
177177
{
178-
$request->validateWithBag('account', [
178+
$request->validate('account', [
179179
'name' => ['required', 'string', 'max:255'],
180180
'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email,'.\Auth::user()->id],
181181
]);
@@ -213,7 +213,7 @@ public function changePasswordStore(Request $request)
213213
}
214214
});
215215

216-
$validator->validateWithBag('password');
216+
$validator->validate();
217217

218218
$user = \Auth::user()->update([
219219
'password' => Hash::make($request->input('old_password')),

resources/js/Pages/Admin/User/AccountInfo.vue

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ const passwordForm = useForm({
6969
name="name"
7070
required
7171
:error="profileForm.errors.name"
72-
/>
72+
>
73+
<div class="text-red-400 text-sm" v-if="profileForm.errors.name">
74+
{{ profileForm.errors.name }}
75+
</div>
76+
</FormControl>
7377
</FormField>
7478
<FormField
7579
label="Email"
@@ -83,7 +87,11 @@ const passwordForm = useForm({
8387
name="email"
8488
required
8589
:error="profileForm.errors.email"
86-
/>
90+
>
91+
<div class="text-red-400 text-sm" v-if="profileForm.errors.email">
92+
{{ profileForm.errors.email }}
93+
</div>
94+
</FormControl>
8795
</FormField>
8896

8997
<template #footer>
@@ -113,7 +121,11 @@ const passwordForm = useForm({
113121
type="password"
114122
required
115123
:error="passwordForm.errors.old_password"
116-
/>
124+
>
125+
<div class="text-red-400 text-sm" v-if="passwordForm.errors.old_password">
126+
{{ passwordForm.errors.old_password }}
127+
</div>
128+
</FormControl>
117129
</FormField>
118130

119131
<BaseDivider />
@@ -130,7 +142,11 @@ const passwordForm = useForm({
130142
type="password"
131143
required
132144
:error="passwordForm.errors.new_password"
133-
/>
145+
>
146+
<div class="text-red-400 text-sm" v-if="passwordForm.errors.new_password">
147+
{{ passwordForm.errors.new_password }}
148+
</div>
149+
</FormControl>
134150
</FormField>
135151

136152
<FormField
@@ -145,7 +161,11 @@ const passwordForm = useForm({
145161
type="password"
146162
required
147163
:error="passwordForm.errors.confirm_password"
148-
/>
164+
>
165+
<div class="text-red-400 text-sm" v-if="passwordForm.errors.confirm_password">
166+
{{ passwordForm.errors.confirm_password }}
167+
</div>
168+
</FormControl>
149169
</FormField>
150170

151171
<template #footer>

0 commit comments

Comments
 (0)