close #2561 Fixed: Countries prefix flaw

This commit is contained in:
Cüneyt Şentürk
2022-08-10 11:16:30 +03:00
parent ddfdfdcb8e
commit 0fd7b4e0c9
8 changed files with 35 additions and 9 deletions

View File

@ -14,7 +14,13 @@ class Customers extends Export
public function map($model): array
{
$model->country = ($model->country) ? trans('countries.' . $model->country) : null;
$country = null;
if ($model->country && array_key_exists($model->country, trans('countries'))) {
$country = trans('countries.' . $model->country);
}
$model->country = $country;
return parent::map($model);
}