Skip to content

Commit

Permalink
Use convert_encoding instead
Browse files Browse the repository at this point in the history
  • Loading branch information
blt950 committed May 25, 2022
1 parent 576012c commit 1e2ec79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/UpdateMemberData.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public function handle()
if (collect($response)->isNotEmpty()) {

$user->email = $response->data->personal->email;
$user->first_name = ucfirst(utf8_encode($response->data->personal->name_first));
$user->last_name = ucfirst(utf8_encode($response->data->personal->name_last));
$user->first_name = ucfirst(mb_convert_encoding($response->data->personal->name_first, "UTF-8"));
$user->last_name = ucfirst(mb_convert_encoding($response->data->personal->name_last, "UTF-8"));
$user->rating = $response->data->vatsim->rating->id;
$user->rating_short = $response->data->vatsim->rating->short;
$user->rating_long = $response->data->vatsim->rating->long;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ protected function completeLogin($resourceOwner, $token)
$account = User::updateOrCreate(
['id' => $resourceOwner->data->cid],
['email' => $resourceOwner->data->personal->email,
'first_name' => ucfirst(utf8_encode($resourceOwner->data->personal->name_first)),
'last_name' => ucfirst(utf8_encode($resourceOwner->data->personal->name_last)),
'first_name' => ucfirst(mb_convert_encoding($resourceOwner->data->personal->name_first)),
'last_name' => ucfirst(mb_convert_encoding($resourceOwner->data->personal->name_last)),
'rating' => $resourceOwner->data->vatsim->rating->id,
'rating_short' => $resourceOwner->data->vatsim->rating->short,
'rating_long' => $resourceOwner->data->vatsim->rating->long,
Expand Down

0 comments on commit 1e2ec79

Please sign in to comment.