/** * Get the count of presence of contract's metadatas * * @param $metadata * @return collection */ public function getMetadataQuality($metadata) { $from = "contracts "; $result = $this->contract->whereRaw(sprintf("contracts.metadata->>'%s'!=''", $metadata))->from($this->db->raw($from))->count(); return $result; }