From: Louis Jeckel Date: Wed, 9 Sep 2020 10:35:46 +0000 (+0200) Subject: Update UsersImport.php X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b237b51c2ab29615d9177856b2b00e1fde7dc62c;p=psq.git Update UsersImport.php --- diff --git a/app/Imports/UsersImport.php b/app/Imports/UsersImport.php index ced033c..2bbdda4 100644 --- a/app/Imports/UsersImport.php +++ b/app/Imports/UsersImport.php @@ -23,6 +23,7 @@ class UsersImport implements ToModel, WithValidation, WithHeadingRow { $org = null; + $userType = $row['user_type'] ?? User::TYPE_SUBSCRIBER; if(!empty($row['org'])) { @@ -40,7 +41,7 @@ class UsersImport implements ToModel, WithValidation, WithHeadingRow 'name' => Str::title($row['org']), ], [ 'type_id' => $type ? $type->id : null, - 'subscription_active' => false, + 'subscription_active' => ($userType === User::TYPE_SUBSCRIBER), ]); } @@ -58,7 +59,7 @@ class UsersImport implements ToModel, WithValidation, WithHeadingRow 'city' => $row['city'], 'phone' => $phone, 'password' => \Hash::make(Str::random()), - 'type' => $row['user_type'] ?? User::TYPE_SUBSCRIBER + 'type' => $userType ]); }