Skip to content

Commit

Permalink
LP-48 json casting issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Oct 14, 2023
1 parent c0ff7b9 commit d7d97fa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Http/Resources/ProfileResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Class ProfileResource
* @package Fintech\Auth\Http\Resources
*
* @property-read mixed $user_profile_data
* @property-read mixed $profile_data
* @property-read string $id_type
* @property-read string|int $id_no
* @property-read string $id_issue_country
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Profile extends Model

protected $guarded = ['id'];

protected $casts = [ 'restored_at' => 'datetime', 'date_of_birth' => 'datetime', 'user_profile_data' => 'json'];
protected $casts = [ 'restored_at' => 'datetime', 'date_of_birth' => 'datetime', 'id_expired_at' => 'datetime', 'id_issue_at' => 'datetime', 'user_profile_data' => 'array'];

/*
|--------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions src/Seeders/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private function data()
"marital_status" => "unmarried",
"occupation" => "service",
"source_of_income" => "salary",
"id_type" => "password",
"id_type" => "passport",
"id_no" => "12345678",
"id_issue_country" => "Bangladesh",
"id_expired_at" => now()->addYears(5)->format('Y-m-d'),
Expand All @@ -62,7 +62,7 @@ private function data()
"present_country_id" => "1",
"present_post_code" => "1234",
"note" => "Testing",
"nationality" => "Bangladesh"
"nationality" => "Bangladeshi"

],
[
Expand All @@ -84,7 +84,7 @@ private function data()
"marital_status" => "unmarried",
"occupation" => "service",
"source_of_income" => "salary",
"id_type" => "password",
"id_type" => "passport",
"id_no" => "12345678",
"id_issue_country" => "Bangladesh",
"id_expired_at" => now()->addYears(5)->format('Y-m-d'),
Expand All @@ -105,7 +105,7 @@ private function data()
"present_country_id" => "1",
"present_post_code" => "1234",
"note" => "Testing",
"nationality" => "Bangladesh"
"nationality" => "Bangladeshi"

],
[
Expand All @@ -127,7 +127,7 @@ private function data()
"marital_status" => "unmarried",
"occupation" => "service",
"source_of_income" => "salary",
"id_type" => "password",
"id_type" => "passport",
"id_no" => "12345678",
"id_issue_country" => "Bangladesh",
"id_expired_at" => now()->addYears(5)->format('Y-m-d'),
Expand All @@ -148,7 +148,7 @@ private function data()
"present_country_id" => "1",
"present_post_code" => "1234",
"note" => "Testing",
"nationality" => "Bangladesh"
"nationality" => "Bangladeshi"

]
];
Expand Down
2 changes: 1 addition & 1 deletion src/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function create(array $inputs = [])

$user = $this->userRepository->create($userData);

$profileData['user_id'] = $user->id;
$profileData['user_id'] = $user->getKey();

$this->profileRepository->create($profileData);

Expand Down

0 comments on commit d7d97fa

Please sign in to comment.