latest broker application fixed in account model

This commit is contained in:
ilmedova 2023-03-28 19:20:23 +05:00
parent 05e1d29fcd
commit 6e1815ed93
1 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ public function getCanExtendBrokerAttribute()
{ {
$month = Config::get('settings.legalization_extend') ?? 1; $month = Config::get('settings.legalization_extend') ?? 1;
if($application = $this->last_application()){ if($application = $this->last_broker_application()){
return $application->state == 'approved' && $this->expires_at->lte(Carbon::now()->subMonths($month)); return $application->state == 'approved' && $this->expires_at->lte(Carbon::now()->subMonths($month));
} }
@ -157,7 +157,7 @@ public function getCanExtendBrokerAttribute()
} }
public function getApplicationBrokerStatusAttribute(){ public function getApplicationBrokerStatusAttribute(){
$application = $this->last_application(); $application = $this->last_broker_application();
return $application->state ?? null; return $application->state ?? null;
} }