dev
Aji Kamaludin 1 year ago
parent 55b8fc2fbd
commit 5d93cba509
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -26,7 +26,7 @@ class ProfileController extends Controller
'name' => 'string|required',
'address' => 'string|required',
'phone' => 'string|required|numeric',
'username' => 'string|required|min:5|alpha_dash|unique:customers,username,'.$customer->id,
'username' => 'string|required|min:5|alpha_dash|unique:customers,username,' . $customer->id,
'password' => 'nullable|string|min:8|confirmed',
'image' => 'nullable|image',
]);
@ -51,7 +51,6 @@ class ProfileController extends Controller
'password' => $customer->password,
]);
redirect()->route('customer.profile.show')
->with('message', ['type' => 'success', 'message' => 'profile updateded']);
session()->flash('message', ['type' => 'success', 'message' => 'profile updateded']);
}
}

@ -26,11 +26,11 @@ export default function CustomerLayout({ children }) {
}
return (
<div className="min-h-screen flex flex-col sm:justify-center items-center max-w-md">
<div className="flex flex-col w-full bg-white shadow pb-20 min-h-[calc(90dvh)]">
<div className="min-h-screen flex flex-col sm:justify-center items-center">
<div className="flex flex-col w-full bg-white shadow pb-20 min-h-[calc(90dvh)] max-w-md">
<div>{children}</div>
</div>
<div className="fixed bottom-0 flex flex-row justify-around w-full bg-gray-50">
<div className="fixed bottom-0 flex flex-row justify-around w-full bg-gray-50 max-w-md">
<div
className="py-2 px-5 hover:bg-blue-200"
onClick={() => handleOnClick('home.index')}

@ -37,7 +37,7 @@ export default function Index({ auth: { user }, flash }) {
const handleSubmit = () => {
post(route('customer.profile.show'), {
onSuccess: () =>
setTimeout(router.get(route(route().current())), 3000),
setTimeout(() => router.get(route(route().current())), 3000),
})
}
@ -46,7 +46,7 @@ export default function Index({ auth: { user }, flash }) {
handleSubmit()
}
}
console.log(user)
return (
<CustomerLayout>
<Head title="Update Profile" />
@ -66,6 +66,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.fullname}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="nama lengkap"
/>
</div>
<div className="w-full">
@ -76,6 +77,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.name}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="nama panggilan"
/>
</div>
<FormInputWith
@ -88,6 +90,7 @@ export default function Index({ auth: { user }, flash }) {
error={errors.phone}
onKeyDownCapture={(e) => handleKeyDown(e)}
formClassName={'pl-10'}
label="whatsapp"
/>
<div className="w-full">
<TextArea
@ -97,6 +100,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.address}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="alamat lengkap"
/>
</div>
<div className="w-full">
@ -107,6 +111,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.username}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="username"
/>
</div>
<div className="w-full">
@ -118,6 +123,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.password}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="password"
/>
</div>
<div className="w-full">
@ -129,6 +135,7 @@ export default function Index({ auth: { user }, flash }) {
onChange={handleOnChange}
error={errors.password_confirmation}
onKeyDownCapture={(e) => handleKeyDown(e)}
label="password confirm"
/>
</div>
<div className="w-full">

@ -25,7 +25,7 @@ export default function Index({ auth: { user } }) {
return (
<CustomerLayout>
<Head title="Profile" />
<div className="flex flex-col min-h-[calc(90dvh)]">
<div className="flex flex-col min-h-[calc(95dvh)]">
<div>
{/* user */}
<div className="flex flex-row justify-between items-center px-5 py-6 text-lg bg-blue-600">

Loading…
Cancel
Save