Using Laravel 6 Getting error
Cannot use object of type stdClass as array
I converted my query to an array.
$filterQuery = DB::table('view_vi_properties');
$filterQuery->select('id','name','bedrooms','max_guests','min_stay','private_pool','private_pool_text','price','security_deposit','pets_allowed','latitude','longitude','pro_address1','pro_address2','pro_city','country','primary_image','slug','rooms');
$filterQuery->whereNotIn('id', explode(',', $comma_property_id));
$filterQuery->whereNotIn('rooms_id', explode(',', $comma_room_id));
$filterQuery->whereNotIn('block_name', explode(',', $comma_block_name));
$filterQuery->where('status', 1)->groupBy('id');
$filterQuery->orderBy('name', 'asc');
$results = $filterQuery->get()->toArray();
print_r($results);
and I'm getting an array but the error is still showing
Array (
[0] => stdClass Object
(
[id] => 4
[name] => Candolim
[bedrooms] => 5
[max_guests] => 9
[min_stay] => 3
[primary_image] => 1646566320.jpg
[slug] => candolim
[rooms] => 7 BR
)
)
$results?