Skip to content

Commit

Permalink
Merge pull request #17 from fintechbd/LP-15-User-Details
Browse files Browse the repository at this point in the history
Lp 15 user details
  • Loading branch information
hafijul233 authored Nov 19, 2023
2 parents a736650 + 88ded04 commit 4a3a869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Http/Requests/StoreUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function rules(): array
'present_country_id' => ['integer', 'nullable'],
'present_post_code' => ['string', 'nullable'],
'nationality' => ['string', 'nullable'],
'status' => ['string', 'nullable'],
]);

$rules[config('fintech.auth.auth_field', 'login_id')] = config('fintech.auth.auth_field_rules', ['required', 'string', 'min:6', 'max:255']);
Expand Down
5 changes: 5 additions & 0 deletions src/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Fintech\Auth\Interfaces\ProfileRepository;
use Fintech\Auth\Interfaces\UserRepository;
use Fintech\Core\Enums\Auth\PasswordResetOption;
use Fintech\Core\Enums\Auth\UserStatus;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
Expand Down Expand Up @@ -101,6 +102,10 @@ private function formatDataFromInput($inputs, bool $forCreate = false)
: $inputs['roles'];
}

if (isset($data['status']) && !empty($data['status'])) {
$data['status'] = $data['status'] ?? UserStatus::Registered->value;
}

return $data;
}

Expand Down

0 comments on commit 4a3a869

Please sign in to comment.