diff --git a/app/Repositories/ClientRepository.php b/app/Repositories/ClientRepository.php index d2a904a9857b..5074e2976ba4 100644 --- a/app/Repositories/ClientRepository.php +++ b/app/Repositories/ClientRepository.php @@ -58,6 +58,10 @@ class ClientRepository extends BaseRepository return $client; } + if(!$client->id && (!array_key_exists('country_id', $data) || empty($data['country_id']))){ + $data['country_id'] = auth()->user()->company()->settings->country_id; + } + $client->fill($data); if (!isset($client->number) || empty($client->number)) {