in Mount
$this->kyc = is_null($existKycRecord) ? $this->user->kyc()->getModel() : $existKycRecord;
Step::make('kyc')->model($this->kyc)
->afterValidation(function (Closure $get) {
$kycForm = [
'type' => $get('user_type'),
'has_tax' => $get('has_tax'),
];
$this->saveKyc($kycForm);
}),
Save function
public function saveKyc($data)
{
$this->kyc = $this->kyc->updateOrCreate(['user_id' => $this->user->id], $data);
$this->form->model($this->kyc)->saveRelationships();
$this->notify('success', 'User KYC Saved successfully!');
}
in Mount
$this->kyc = is_null($existKycRecord) ? $this->user->kyc()->getModel() : $existKycRecord;
Step::make('kyc')->model($this->kyc)
->afterValidation(function (Closure $get) {
$kycForm = [
'type' => $get('user_type'),
'has_tax' => $get('has_tax'),
];
$this->saveKyc($kycForm);
}),
Save function
public function saveKyc($data)
{
$this->kyc = $this->kyc->updateOrCreate(['user_id' => $this->user->id], $data);
$this->form->model($this->kyc)->saveRelationships();
$this->notify('success', 'User KYC Saved successfully!');
}