672367 lte gte fxx3

This commit is contained in:
merdan 2022-12-07 14:16:27 +05:00
parent 54ba85af3b
commit e8318f094b
2 changed files with 6 additions and 4 deletions

View File

@ -43,9 +43,7 @@ public function create()
],422);
}
//validate legalization number exists
elseif( !empty($this->account->legalization_number) && //legalizasia nomeri bar bolsa
(!empty( $this->account->expires_at) && //legalizasia srogy
!$this->account->can_extend_legal_number)){//eger srogyn gutarmagyna 1 ay galmadyk bolsa
elseif(!$this->account->can_extend_legal_number){//eger srogyn gutarmagyna 1 ay galmadyk bolsa
$month = Config::get('settings.legalization_extend') ?? 1;
return response([
'success' => false,

View File

@ -115,7 +115,11 @@ public function getCanExtendLegalNumberAttribute()
$month = Config::get('settings.legalization_extend') ?? 1;
return $application && $application->state == 'approved' && $this->expires_at->gte(Carbon::now()->subMonth($month));
if($application){
return $application->state == 'approved' && $this->expires_at->gte(Carbon::now()->subMonths($month));
}
return !empty($this->legalization_number) && !empty( $this->expires_at) && $this->expires_at->gte(Carbon::now()->subMonths($month));
}
public function getApplicationStatusAttribute(){