My code like this :
$test = $this->vendorRepository->getVendor($request->get('q'));
If I dd($test), the result is collection like this :
I want to convert it to array
I try like this :
dd($test->toArray());
The result like this :
value of id changed to 0
Why did it happen? How can I solve this problem?

