diff --git a/app/Http/Controllers/Customer/ProfileController.php b/app/Http/Controllers/Customer/ProfileController.php index 704ba51..9a82aa8 100644 --- a/app/Http/Controllers/Customer/ProfileController.php +++ b/app/Http/Controllers/Customer/ProfileController.php @@ -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']); } } diff --git a/resources/js/Layouts/CustomerLayout.jsx b/resources/js/Layouts/CustomerLayout.jsx index dd8557a..ca0e4a4 100644 --- a/resources/js/Layouts/CustomerLayout.jsx +++ b/resources/js/Layouts/CustomerLayout.jsx @@ -26,11 +26,11 @@ export default function CustomerLayout({ children }) { } return ( -