prof test
This commit is contained in:
parent
510616ad1d
commit
b5d92e22a4
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue