prof test

This commit is contained in:
merdan 2022-08-30 11:02:33 +05:00
parent 510616ad1d
commit b5d92e22a4
1 changed files with 3 additions and 3 deletions

View File

@ -18,14 +18,14 @@ public function toArray($request)
'bank_account' => $this->bank ? BankResource::make(json_decode($this->bank)):null,
'contacts' => $this->contacts ? ContactResource::make(json_decode($this->contacts)):null,
'account_type' => $this->type,
'profile' => $this->profile()
'profile' => $this->getProfile()
];
}
private function profile() : JsonResource
private function getProfile() : JsonResource
{
$type = config('account.'.$this->type.'.resources');
return $type::make($this->profile);
return new $type($this->profile);
}
}