Trying to get property 'vendor_id' of non-object