From c0ff35c0a8db3a2402f6d2fef9a9d167e483be07 Mon Sep 17 00:00:00 2001 From: AmirmahdiNourkazemi Date: Wed, 10 Jun 2026 12:02:23 +0330 Subject: [PATCH] feat: add status in v2 --- app/Http/Controllers/UserController.php | 2 ++ ...26_06_10_000000_add_age_to_users_table.php | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 database/migrations/2026_06_10_000000_add_age_to_users_table.php diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 6a66e62..3983779 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -92,6 +92,7 @@ public function loginV2(Request $request) 'identifier' => $user->identifier, 'token' => $access_token, 'user' => $user, + 'status' => $response, ]; } @@ -500,6 +501,7 @@ public function updateProfile(Request $request) 'first_name' => 'string|nullable', 'last_name' => 'string|nullable', 'birthday' => 'date|nullable', + 'age' => 'integer|nullable|min:0|max:120', 'gender' => ['integer', 'nullable', Rule::in(User::GENDERS)], 'email' => 'email|nullable', 'mobile' => [new MobileNumber, 'string'], diff --git a/database/migrations/2026_06_10_000000_add_age_to_users_table.php b/database/migrations/2026_06_10_000000_add_age_to_users_table.php new file mode 100644 index 0000000..64d4800 --- /dev/null +++ b/database/migrations/2026_06_10_000000_add_age_to_users_table.php @@ -0,0 +1,26 @@ +unsignedTinyInteger('age')->nullable()->after('birthday'); + } + }); + } + + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + if (Schema::hasColumn('users', 'age')) { + $table->dropColumn('age'); + } + }); + } +};