This commit is contained in:
parent
9a0c18b6dc
commit
b60f61ad1f
6 changed files with 36 additions and 33 deletions
|
|
@ -129,7 +129,9 @@ class CrmUserProvider extends EloquentUserProvider implements UserProvider
|
|||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Model $model */
|
||||
$model = $this->usedModel::firstOrNew([
|
||||
'email' => $crmCustomer->email
|
||||
'email' => $crmCustomer->email,
|
||||
'firstname' => $crmCustomer->firstname,
|
||||
'lastname' => $crmCustomer->lastname,
|
||||
]);
|
||||
// @phpstan-ignore-next-line
|
||||
$model->hashcode = $crmCustomer->hashcode;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,11 @@ class LoginController extends Controller
|
|||
}
|
||||
|
||||
/** @var \App\Models\Customer $customerModel */
|
||||
$customerModel = new Customer(Arr::only($crmCustomer->jsonSerialize(), ['email']));
|
||||
$customerModel = new Customer(Arr::only($crmCustomer->jsonSerialize(), [
|
||||
'firstname',
|
||||
'lastname',
|
||||
'email',
|
||||
]));
|
||||
$customerModel->hashcode = $crmCustomer->hashcode;
|
||||
|
||||
if (!$customerModel->saveOrFail()) {
|
||||
|
|
|
|||
|
|
@ -158,17 +158,17 @@ class RegisterController extends Controller
|
|||
return \array_intersect_key(
|
||||
$data,
|
||||
[
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'birth_date' => '',
|
||||
'address' => '',
|
||||
'postcode' => '',
|
||||
'country' => '',
|
||||
'city' => '',
|
||||
'phone' => '',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
'opt_in' => '',
|
||||
'address' => '',
|
||||
'postcode' => '',
|
||||
'country' => '',
|
||||
'city' => '',
|
||||
'phone' => '',
|
||||
'email' => '',
|
||||
'password' => '',
|
||||
'opt_in' => '',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,9 +65,6 @@ class ResetPasswordController extends Controller
|
|||
*/
|
||||
protected function resetPassword($customer, $password)
|
||||
{
|
||||
/** @var \App\Models\Customer\Customer $user */
|
||||
/** @var string $password */
|
||||
|
||||
/** @var \LDC\LDCCRM\CrmApiV4 */
|
||||
$crm = app('crmAPI');
|
||||
|
||||
|
|
|
|||
|
|
@ -31,16 +31,16 @@ class CustomerCrmResource extends JsonResource
|
|||
/** @var \LDC\LDCCRM\Models\Customer */
|
||||
$crmCustomer = $this->customer->api_data;
|
||||
return [
|
||||
'hashcode' => $this->customer->hashcode,
|
||||
'hashcode' => $this->customer->hashcode,
|
||||
'firstname' => $crmCustomer->firstname,
|
||||
'lastname' => $crmCustomer->lastname,
|
||||
'opt_in' => $crmCustomer->opt_in,
|
||||
'lastname' => $crmCustomer->lastname,
|
||||
'opt_in' => $crmCustomer->opt_in,
|
||||
'birthdate' => $crmCustomer->birth_date,
|
||||
'phone' => $crmCustomer->phone,
|
||||
'address' => $crmCustomer->address,
|
||||
'address2' => $crmCustomer->address2,
|
||||
'city' => $crmCustomer->city,
|
||||
'postcode' => $crmCustomer->postcode
|
||||
'phone' => $crmCustomer->phone,
|
||||
'address' => $crmCustomer->address,
|
||||
'address2' => $crmCustomer->address2,
|
||||
'city' => $crmCustomer->city,
|
||||
'postcode' => $crmCustomer->postcode
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,17 +284,17 @@ class Customer extends Authenticatable implements MustVerifyEmail, CanResetPassw
|
|||
parent::toArray(),
|
||||
(array)$this->apiData
|
||||
))->intersectByKeys([
|
||||
'email' => '',
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'address' => '',
|
||||
'address2' => '',
|
||||
'postcode' => '',
|
||||
'email' => '',
|
||||
'firstname' => '',
|
||||
'lastname' => '',
|
||||
'address' => '',
|
||||
'address2' => '',
|
||||
'postcode' => '',
|
||||
'birth_date' => '',
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'opt_in' => '',
|
||||
'phone' => ''
|
||||
'city' => '',
|
||||
'country' => '',
|
||||
'opt_in' => '',
|
||||
'phone' => '',
|
||||
])->toArray();
|
||||
} else {
|
||||
return parent::toArray();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue