authorize('manageOwnProfile', Customer::class); return view('fo.customer.edit.password'); } public function editPasswordSubmit(UpdatePasswordRequest $request, UpdateCustomerPassword $updateCustomerPassword): RedirectResponse { $this->authorize('manageOwnProfile', Customer::class); $result = $this->executor->execute( $updateCustomerPassword, $request->toUpdateCustomerPasswordInput() ); return match (true) { $result->result instanceof CrmCustomer => back() ->with('success', trans('Password updated')), $result->result instanceof ValidationException => back() ->withErrors($result->result->errors()), $result->result === false => back() ->withErrors(trans('An error occurred, please try again later.')), }; } }