Aiden-IPI
8 months ago
174
5
Laravel

Resource Collection - Property [*] does not exist on this collection instance.

Posted 8 months ago by Aiden-IPI

I am using Resource Collection to retrieve all the information from my database.

This information includes all the company information and its relationship with the company which is the industry.

It returns this error when I tried to fetch the information.

Property [name] does not exist on this collection instance.

return parent::toArray([
    'name' => $this->name,
    'industry' => $this->industry
]);

May I know how to rectify this?

Please sign in or create an account to participate in this conversation.