From 25b56b27096a617b52dd4b78bef0e7f1eefc2832 Mon Sep 17 00:00:00 2001 From: miftahurrahmi Date: Fri, 22 Sep 2023 17:25:07 +0700 Subject: [PATCH 1/5] add field address --- src/Controllers/BadasoAuthController.php | 6 ++++ src/Controllers/BadasoUserController.php | 8 +++++ ...4333_add_address_to_badaso_users_table.php | 32 +++++++++++++++++++ src/Models/User.php | 1 + src/resources/js/lang/modules/en.js | 31 +++++++++++++++--- src/resources/js/lang/modules/id.js | 31 +++++++++++++++--- src/resources/js/pages/auth/register.vue | 26 +++++++++++++++ .../js/pages/user-management/add.vue | 18 +++++++++++ .../js/pages/user-management/edit.vue | 18 +++++++++++ .../js/pages/user-management/read.vue | 8 +++++ src/resources/js/pages/user/profile.vue | 18 +++++++++++ 11 files changed, 187 insertions(+), 10 deletions(-) create mode 100644 src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php diff --git a/src/Controllers/BadasoAuthController.php b/src/Controllers/BadasoAuthController.php index 155abbc0b..ceffa803f 100644 --- a/src/Controllers/BadasoAuthController.php +++ b/src/Controllers/BadasoAuthController.php @@ -175,6 +175,7 @@ public function register(Request $request) 'phone' => 'required|numeric|min:6', 'email' => 'required|string|email|max:255|unique:Uasoft\Badaso\Models\User', 'password' => 'required|string|min:6|confirmed', + 'address' => 'nullable', ]); $user = User::create([ @@ -183,6 +184,7 @@ public function register(Request $request) 'phone' => $request->get('phone'), 'email' => $request->get('email'), 'password' => Hash::make($request->get('password')), + 'address' => $request->get('address'), ]); $role = $this->getCustomerRole(); @@ -540,12 +542,16 @@ public function updateProfile(Request $request) 'name' => 'required|string|max:255', 'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$user_id}", 'avatar' => 'nullable', + 'phone' => 'nullable', + 'address' => 'nullable', ]); $user = User::find($user->id); $user->name = $request->name; $user->username = $request->username; + $user->phone = $request->phone; + $user->address = $request->address; $user->avatar = $request->avatar; $user->additional_info = $request->additional_info; $user->save(); diff --git a/src/Controllers/BadasoUserController.php b/src/Controllers/BadasoUserController.php index 2f4295cbb..e1e9a0f2c 100644 --- a/src/Controllers/BadasoUserController.php +++ b/src/Controllers/BadasoUserController.php @@ -57,6 +57,8 @@ public function edit(Request $request) 'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$request->id}", 'name' => 'required', 'avatar' => 'nullable', + 'phone' => 'nullable', + 'address' => 'nullable', ]); $user = User::find($request->id); @@ -64,6 +66,8 @@ public function edit(Request $request) $user->name = $request->name; $user->email = $request->email; + $user->phone = $request->phone; + $user->address = $request->address; $user->avatar = $request->avatar; $user->additional_info = $request->additional_info; if ($request->password && $request->password != '') { @@ -104,11 +108,15 @@ public function add(Request $request) 'name' => 'required|string|max:255', 'username' => 'required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username', 'avatar' => 'nullable', + 'phone' => 'required|numeric|min:6', + 'address' => 'nullable', ]); $user = new User(); $user->name = $request->name; $user->username = $request->username; + $user->phone = $request->phone; + $user->address = $request->address; $user->email = $request->email; $user->avatar = $request->avatar; $user->additional_info = $request->additional_info; diff --git a/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php b/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php new file mode 100644 index 000000000..ca1f93695 --- /dev/null +++ b/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php @@ -0,0 +1,32 @@ +text('address')->nullable()->after('phone'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { + $table->dropColumn('address'); + }); + } +} diff --git a/src/Models/User.php b/src/Models/User.php index 5aa62034d..79fe85fbf 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -39,6 +39,7 @@ public function __construct(array $attributes = []) 'email', 'password', 'avatar', + 'address', 'additional_info', 'last_sent_token_at', ]; diff --git a/src/resources/js/lang/modules/en.js b/src/resources/js/lang/modules/en.js index 036760c10..836606834 100644 --- a/src/resources/js/lang/modules/en.js +++ b/src/resources/js/lang/modules/en.js @@ -40,7 +40,8 @@ export default { field: { name: "Name", username: "Username", - phone:"Phone", + phone: "Phone", + address: "Address", email: "Email", password: "Password", passwordConfirmation: "Password Confirmation", @@ -125,6 +126,8 @@ export default { newPasswordConfirmation: "New Password Confirmation", name: "Name", avatar: "Avatar", + phone: "Phone Number", + address: "Address", additionalInfo: "Additional info(optional)", token: "Verification Code", buttons: { @@ -251,7 +254,7 @@ export default { edit: { multiple: "Update Configurations", }, - maintenanceMode: "Maintenance setting is readonly." + maintenanceMode: "Maintenance setting is readonly.", }, crud: { @@ -666,6 +669,14 @@ export default { title: "Username", placeholder: "Username", }, + phone: { + title: "Phone Number", + placeholder: "Phone Number", + }, + address: { + title: "Address", + placeholder: "Address", + }, email: { title: "Email", placeholder: "Email", @@ -701,6 +712,14 @@ export default { title: "Username", placeholder: "Username", }, + phone: { + title: "Phone Number", + placeholder: "Phone Number", + }, + address: { + title: "Address", + placeholder: "Address", + }, email: { title: "Email", placeholder: "Email", @@ -730,6 +749,8 @@ export default { avatar: "Avatar", name: "Name", username: "Username", + phone: "Phone Number", + address: "Address", email: "Email", additionalInfo: "Additional Info", emailVerified: "Is Email Verified", @@ -850,7 +871,7 @@ export default { isPublic: "Is Public", action: "Action", rolesCanSeeAllData: "Roles Can See All Data", - fieldIdentifyRelatedUser: "Field Identify Related User" + fieldIdentifyRelatedUser: "Field Identify Related User", }, footer: { descriptionTitle: "Registries", @@ -901,7 +922,7 @@ export default { fieldIdentifyRelatedUser: { title: "Column for identify user related data", placeholder: "Column for identify user related data", - } + }, }, button: "Save", }, @@ -922,7 +943,7 @@ export default { }, button: "Edit", rolesCanSeeAllData: "Roles Can See All Data", - fieldIdentifyRelatedUser: "Field Identify Related User" + fieldIdentifyRelatedUser: "Field Identify Related User", }, }, diff --git a/src/resources/js/lang/modules/id.js b/src/resources/js/lang/modules/id.js index 36083b50a..7b1338bd5 100644 --- a/src/resources/js/lang/modules/id.js +++ b/src/resources/js/lang/modules/id.js @@ -40,7 +40,8 @@ export default { field: { name: "Nama", username: "Username", - phone: "Phone", + phone: "No Telp/Hp", + address: "Alamat", email: "Email", password: "Kata sandi", passwordConfirmation: "Konfirmasi kata sandi", @@ -125,6 +126,8 @@ export default { newPasswordConfirmation: "New Password Confirmation", name: "Name", avatar: "Avatar", + phone: "No Telp/Hp", + address: "Alamat", additionalInfo: "Additional info(optional)", token: "Verification Code", buttons: { @@ -251,7 +254,7 @@ export default { edit: { multiple: "Simpan Konfigurasi", }, - maintenanceMode: "Pengaturan maintenance hanya readonly." + maintenanceMode: "Pengaturan maintenance hanya readonly.", }, crud: { @@ -650,6 +653,14 @@ export default { title: "Username", placeholder: "Username", }, + phone: { + title: "No Telp/Hp", + placeholder: "No Telp/Hp", + }, + address: { + title: "Alamat", + placeholder: "Alamat", + }, password: { title: "Kata sandi", placeholder: "Kata sandi", @@ -681,6 +692,14 @@ export default { title: "Username", placeholder: "Username", }, + phone: { + title: "No Telp/Hp", + placeholder: "No Telp/Hp", + }, + address: { + title: "Alamat", + placeholder: "Alamat", + }, email: { title: "Email", placeholder: "Email", @@ -710,6 +729,8 @@ export default { avatar: "Avatar", name: "Nama", username: "Username", + phone: "No Telp/Hp", + address: "Alamat", email: "Email", additionalInfo: "Info Tambahan", emailVerified: "Email Diverifikasi", @@ -825,7 +846,7 @@ export default { isPublic: "Publik", action: "Aksi", rolesCanSeeAllData: "Role yang dapat melihat semua data", - fieldIdentifyRelatedUser: "Kolom relasi untuk identifikasi data user" + fieldIdentifyRelatedUser: "Kolom relasi untuk identifikasi data user", }, help: { alwaysAllow: @@ -881,7 +902,7 @@ export default { fieldIdentifyRelatedUser: { title: "Kolom relasi untuk identifikasi data user", placeholder: "Kolom relasi untuk identifikasi data user", - } + }, }, button: "Simpan", }, @@ -902,7 +923,7 @@ export default { }, button: "Ubah", rolesCanSeeAllData: "Role yang dapat melihat semua data", - fieldIdentifyRelatedUser: "Kolom relasi untuk identifikasi data user" + fieldIdentifyRelatedUser: "Kolom relasi untuk identifikasi data user", }, }, diff --git a/src/resources/js/pages/auth/register.vue b/src/resources/js/pages/auth/register.vue index 4d033bbc5..0dca15d59 100644 --- a/src/resources/js/pages/auth/register.vue +++ b/src/resources/js/pages/auth/register.vue @@ -98,6 +98,30 @@ + + +
+
+ + {{ info }} + +
+
+ +
+
+ + + + + {{ $t("user.detail.username") }} {{ user.username }} + + + {{ $t("user.detail.phone") }} + {{ user.phone }} + + + {{ $t("user.detail.address") }} + {{ user.address }} {{ $t("user.detail.email") }} diff --git a/src/resources/js/pages/user/profile.vue b/src/resources/js/pages/user/profile.vue index fc557b8e4..a3c72da07 100644 --- a/src/resources/js/pages/user/profile.vue +++ b/src/resources/js/pages/user/profile.vue @@ -20,6 +20,13 @@ :label="$t('myProfile.username')" :placeholder="$t('myProfile.username')" :alert="errors.username" + > + + Date: Fri, 22 Sep 2023 10:26:30 +0000 Subject: [PATCH 2/5] Apply fixes from StyleCI --- .../2023_09_22_084333_add_address_to_badaso_users_table.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php b/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php index ca1f93695..6effee1f4 100644 --- a/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php +++ b/src/Migrations/2023_09_22_084333_add_address_to_badaso_users_table.php @@ -13,7 +13,7 @@ class AddAddressToBadasoUsersTable extends Migration */ public function up() { - Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { + Schema::table(config('badaso.database.prefix').'users', function (Blueprint $table) { $table->text('address')->nullable()->after('phone'); }); } @@ -25,7 +25,7 @@ public function up() */ public function down() { - Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { + Schema::table(config('badaso.database.prefix').'users', function (Blueprint $table) { $table->dropColumn('address'); }); } From 3549f556a9f43ca278f9f19d8189f04508f07032 Mon Sep 17 00:00:00 2001 From: miftahurrahmi Date: Mon, 25 Sep 2023 16:12:59 +0700 Subject: [PATCH 3/5] add gender v2 --- src/Controllers/BadasoAuthController.php | 8 +- src/Controllers/BadasoUserController.php | 4 + ...34306_add_gender_to_badaso_users_table.php | 32 ++++++ src/Models/User.php | 1 + src/resources/js/lang/modules/en.js | 19 ++++ src/resources/js/lang/modules/id.js | 9 ++ src/resources/js/pages/auth/register.vue | 103 +++++++++++------- .../js/pages/user-management/add.vue | 31 +++--- .../js/pages/user-management/edit.vue | 24 +++- .../js/pages/user-management/read.vue | 4 + src/resources/js/pages/user/profile.vue | 49 ++++++--- 11 files changed, 212 insertions(+), 72 deletions(-) create mode 100644 src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php diff --git a/src/Controllers/BadasoAuthController.php b/src/Controllers/BadasoAuthController.php index ceffa803f..cf0c22121 100644 --- a/src/Controllers/BadasoAuthController.php +++ b/src/Controllers/BadasoAuthController.php @@ -175,7 +175,8 @@ public function register(Request $request) 'phone' => 'required|numeric|min:6', 'email' => 'required|string|email|max:255|unique:Uasoft\Badaso\Models\User', 'password' => 'required|string|min:6|confirmed', - 'address' => 'nullable', + 'address' => 'required|string|max:255', + 'gender' => 'required|string', ]); $user = User::create([ @@ -185,6 +186,7 @@ public function register(Request $request) 'email' => $request->get('email'), 'password' => Hash::make($request->get('password')), 'address' => $request->get('address'), + 'gender' => $request->get('gender'), ]); $role = $this->getCustomerRole(); @@ -543,7 +545,8 @@ public function updateProfile(Request $request) 'username' => "required|string|max:255|alpha_num|unique:Uasoft\Badaso\Models\User,username,{$user_id}", 'avatar' => 'nullable', 'phone' => 'nullable', - 'address' => 'nullable', + 'address' => 'nullable', + 'gender' => 'nullable', ]); $user = User::find($user->id); @@ -554,6 +557,7 @@ public function updateProfile(Request $request) $user->address = $request->address; $user->avatar = $request->avatar; $user->additional_info = $request->additional_info; + $user->gender = $request->gender; $user->save(); DB::commit(); diff --git a/src/Controllers/BadasoUserController.php b/src/Controllers/BadasoUserController.php index e1e9a0f2c..1448fe321 100644 --- a/src/Controllers/BadasoUserController.php +++ b/src/Controllers/BadasoUserController.php @@ -59,6 +59,7 @@ public function edit(Request $request) 'avatar' => 'nullable', 'phone' => 'nullable', 'address' => 'nullable', + 'gender' => 'nullable', ]); $user = User::find($request->id); @@ -69,6 +70,7 @@ public function edit(Request $request) $user->phone = $request->phone; $user->address = $request->address; $user->avatar = $request->avatar; + $user->gender = $request->gender; $user->additional_info = $request->additional_info; if ($request->password && $request->password != '') { $user->password = Hash::make($request->password); @@ -110,6 +112,7 @@ public function add(Request $request) 'avatar' => 'nullable', 'phone' => 'required|numeric|min:6', 'address' => 'nullable', + 'gender' => 'required|string', ]); $user = new User(); @@ -120,6 +123,7 @@ public function add(Request $request) $user->email = $request->email; $user->avatar = $request->avatar; $user->additional_info = $request->additional_info; + $user->gender = $request->gender; $user->password = Hash::make($request->password); if ($request->email_verified) { $user->email_verified_at = date('Y-m-d H:i:s'); diff --git a/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php b/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php new file mode 100644 index 000000000..1b3f9f6f4 --- /dev/null +++ b/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php @@ -0,0 +1,32 @@ +enum('gender', ['man', 'woman'])->nullable()->after('additional_info');; + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { + $table->dropColumn('gender'); + }); + } +} diff --git a/src/Models/User.php b/src/Models/User.php index 79fe85fbf..7b1455ea1 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -40,6 +40,7 @@ public function __construct(array $attributes = []) 'password', 'avatar', 'address', + 'gender', 'additional_info', 'last_sent_token_at', ]; diff --git a/src/resources/js/lang/modules/en.js b/src/resources/js/lang/modules/en.js index 836606834..8da2cb4b1 100644 --- a/src/resources/js/lang/modules/en.js +++ b/src/resources/js/lang/modules/en.js @@ -45,12 +45,17 @@ export default { email: "Email", password: "Password", passwordConfirmation: "Password Confirmation", + gender: "Gender", }, button: "Register", existingAccount: { text: "Do you have an account?", link: "Login", }, + gender: { + man: "Man", + woman: "Woman", + }, }, forgotPassword: { @@ -128,6 +133,7 @@ export default { avatar: "Avatar", phone: "Phone Number", address: "Address", + gender: "Gender", additionalInfo: "Additional info(optional)", token: "Verification Code", buttons: { @@ -693,6 +699,10 @@ export default { title: "Avatar", placeholder: "Avatar", }, + gender: { + title: "Gender", + placeholder: "Gender", + }, additionalInfo: { title: "Additional Info (JSON)", placeholder: "Additional Info (JSON)", @@ -736,6 +746,10 @@ export default { title: "Avatar", placeholder: "New Avatar", }, + gender: { + title: "Gender", + placeholder: "Gender", + }, additionalInfo: { title: "Additional Info (JSON)", placeholder: "Additional Info (JSON)", @@ -752,6 +766,7 @@ export default { phone: "Phone Number", address: "Address", email: "Email", + gender: "Gender", additionalInfo: "Additional Info", emailVerified: "Is Email Verified", }, @@ -768,6 +783,10 @@ export default { text: "Roles has been set", }, }, + gender: { + man: "Man", + woman: "Woman", + }, }, role: { diff --git a/src/resources/js/lang/modules/id.js b/src/resources/js/lang/modules/id.js index 7b1338bd5..0b9dba764 100644 --- a/src/resources/js/lang/modules/id.js +++ b/src/resources/js/lang/modules/id.js @@ -42,6 +42,7 @@ export default { username: "Username", phone: "No Telp/Hp", address: "Alamat", + gender: "Jenis Kelamin", email: "Email", password: "Kata sandi", passwordConfirmation: "Konfirmasi kata sandi", @@ -128,6 +129,7 @@ export default { avatar: "Avatar", phone: "No Telp/Hp", address: "Alamat", + gender: "Jenis Kelamin", additionalInfo: "Additional info(optional)", token: "Verification Code", buttons: { @@ -673,6 +675,9 @@ export default { title: "Avatar", placeholder: "Avatar", }, + gender: { + title: "Jenis Kelamin", + }, additionalInfo: { title: "Info Tambahan (JSON)", placeholder: "Info Tambahan (JSON)", @@ -716,6 +721,9 @@ export default { title: "Avatar", placeholder: "Avatar Baru", }, + gender: { + title: "Jenis Kelamin", + }, additionalInfo: { title: "Info Tambahan (JSON)", placeholder: "Info Tambahan (JSON)", @@ -732,6 +740,7 @@ export default { phone: "No Telp/Hp", address: "Alamat", email: "Email", + gender: "Jenis Kelamin", additionalInfo: "Info Tambahan", emailVerified: "Email Diverifikasi", }, diff --git a/src/resources/js/pages/auth/register.vue b/src/resources/js/pages/auth/register.vue index 0dca15d59..d680d8be0 100644 --- a/src/resources/js/pages/auth/register.vue +++ b/src/resources/js/pages/auth/register.vue @@ -53,7 +53,27 @@ > - + +
+
+ + {{ info }} + +
+
+ +
+
- - -
-
- - {{ info }} - -
-
- -
-
- + +
+
+ + {{ info }} + +
+
+ +
+
export default { name: "AuthRegister", - data: () => ({ - errors: {}, - name: "", - username: "", - phone:"", - address:"", - email: "", - password: "", - passwordConfirmation: "", - baseUrl: process.env.MIX_ADMIN_PANEL_ROUTE_PREFIX - ? process.env.MIX_ADMIN_PANEL_ROUTE_PREFIX - : "badaso-dashboard", - }), + data() { + return { + errors: {}, + name: "", + username: "", + phone:"", + address:"", + gender:"", + email: "", + password: "", + passwordConfirmation: "", + baseUrl: process.env.MIX_ADMIN_PANEL_ROUTE_PREFIX + ? process.env.MIX_ADMIN_PANEL_ROUTE_PREFIX + : "badaso-dashboard", + + genderitems:[ + { label: this.$t("register.gender.man"), value: "man" }, + { label: this.$t("register.gender.woman"), value: "woman" }, + ] + }; + }, methods: { register() { this.$openLoader(); @@ -204,6 +230,7 @@ export default { email: this.email, password: this.password, passwordConfirmation: this.passwordConfirmation, + gender: this.gender, }) .then((response) => { this.$closeLoader(); diff --git a/src/resources/js/pages/user-management/add.vue b/src/resources/js/pages/user-management/add.vue index e411c9bce..290920bdb 100644 --- a/src/resources/js/pages/user-management/add.vue +++ b/src/resources/js/pages/user-management/add.vue @@ -53,6 +53,14 @@ :placeholder="$t('user.add.field.phone.placeholder')" :alert="errors.phone" > + ({ + data() { + return { errors: {}, user: { email: "", @@ -110,8 +119,14 @@ export default { password: "", emailVerified: false, additionalInfo: "", + gender:"", }, - }), + gender: [ + { label: this.$t("user.gender.man"), value: "man" }, + { label: this.$t("user.gender.woman"), value: "woman" }, + ], + }; + }, mounted() {}, methods: { submitForm() { @@ -122,17 +137,7 @@ export default { } this.$openLoader(); this.$api.badasoUser - .add({ - email: this.user.email, - name: this.user.name, - username: this.user.username, - phone: this.user.phone, - address: this.user.address, - avatar: this.user.avatar, - password: this.user.password, - emailVerified: this.user.emailVerified, - additionalInfo: this.user.additionalInfo, - }) + .add(this.user) .then((response) => { this.$closeLoader(); this.$router.push({ name: "UserManagementBrowse" }); diff --git a/src/resources/js/pages/user-management/edit.vue b/src/resources/js/pages/user-management/edit.vue index 042b9d114..3b2ff3c98 100644 --- a/src/resources/js/pages/user-management/edit.vue +++ b/src/resources/js/pages/user-management/edit.vue @@ -53,6 +53,14 @@ :placeholder="$t('user.edit.field.phone.placeholder')" :alert="errors.phone" > + ({ - errors: {}, + data() { + return { + errors: {}, user: { email: "", name: "", username: "", phone: "", - address:"", + address: "", avatar: "", password: "", emailVerified: false, additionalInfo: "", + gender:"", }, - }), + gender: [ + { label: this.$t("user.gender.man"), value: "man" }, + { label: this.$t("user.gender.woman"), value: "woman" }, + ], + }; + }, computed: { loggedInUser: { get() { @@ -162,6 +177,7 @@ export default { password: this.user.password, emailVerified: this.user.emailVerified, additionalInfo: JSON.stringify(this.user.additionalInfo), + gender: this.user.gender, }) .then((response) => { if (this.loggedInUser.id == this.user.id) { diff --git a/src/resources/js/pages/user-management/read.vue b/src/resources/js/pages/user-management/read.vue index 36e4317d8..bbf8bafd4 100644 --- a/src/resources/js/pages/user-management/read.vue +++ b/src/resources/js/pages/user-management/read.vue @@ -42,6 +42,10 @@ {{ $t("user.detail.username") }} {{ user.username }} + + + {{ $t("user.detail.gender") }} + {{ user.gender }} {{ $t("user.detail.phone") }} diff --git a/src/resources/js/pages/user/profile.vue b/src/resources/js/pages/user/profile.vue index a3c72da07..3ba80097b 100644 --- a/src/resources/js/pages/user/profile.vue +++ b/src/resources/js/pages/user/profile.vue @@ -21,6 +21,14 @@ :placeholder="$t('myProfile.username')" :alert="errors.username" > + ({ - errors: {}, - user: { - email: "", - name: "", - username: "", - avatar: "", - phone:"", - address:"", - additionalInfo: "", - oldPassword: "", - newPassword: "", - newPasswordConfirmation: "", - }, - token: "", - shouldVerifyEmail: false, + }), + data() { + return{ + errors: {}, + user: { + email: "", + name: "", + username: "", + avatar: "", + phone:"", + address:"", + additionalInfo: "", + oldPassword: "", + newPassword: "", + newPasswordConfirmation: "", + gender:"", + }, + token: "", + shouldVerifyEmail: false, + gender: [ + { label: this.$t("user.gender.man"), value: "man" }, + { label: this.$t("user.gender.woman"), value: "woman" }, + ], + }; + }, mounted() { this.getUser(); }, @@ -201,6 +219,7 @@ export default { avatar: this.user.avatar, phone: this.user.phone, address: this.user.address, + gender: this.user.gender, additionalInfo: this.user.additionalInfo !== "" ? JSON.stringify(this.user.additionalInfo) From bdf0238ab10d9317d033448d20b461f79e9faba5 Mon Sep 17 00:00:00 2001 From: miftahurrahmi Date: Tue, 26 Sep 2023 09:08:46 +0700 Subject: [PATCH 4/5] update register form --- src/resources/js/pages/auth/register.vue | 39 ++++++++---------------- src/resources/js/pages/user/profile.vue | 3 -- 2 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/resources/js/pages/auth/register.vue b/src/resources/js/pages/auth/register.vue index d680d8be0..42caa7c27 100644 --- a/src/resources/js/pages/auth/register.vue +++ b/src/resources/js/pages/auth/register.vue @@ -53,27 +53,7 @@ > - -
-
- - {{ info }} - -
-
- -
-
+ - + ({ - - }), data() { return{ errors: {}, From 11b97a40f612ec89e70a900fede51331937fde77 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 26 Sep 2023 02:09:44 +0000 Subject: [PATCH 5/5] Apply fixes from StyleCI --- .../2023_09_25_034306_add_gender_to_badaso_users_table.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php b/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php index 1b3f9f6f4..5ef085a1d 100644 --- a/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php +++ b/src/Migrations/2023_09_25_034306_add_gender_to_badaso_users_table.php @@ -13,8 +13,8 @@ class AddGenderToBadasoUsersTable extends Migration */ public function up() { - Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { - $table->enum('gender', ['man', 'woman'])->nullable()->after('additional_info');; + Schema::table(config('badaso.database.prefix').'users', function (Blueprint $table) { + $table->enum('gender', ['man', 'woman'])->nullable()->after('additional_info'); }); } @@ -25,7 +25,7 @@ public function up() */ public function down() { - Schema::table(config('badaso.database.prefix') . 'users', function (Blueprint $table) { + Schema::table(config('badaso.database.prefix').'users', function (Blueprint $table) { $table->dropColumn('gender'); }); }