belongsTo('App\Transaction', 'transaction_hash_id', 'hash'); } /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function claimInLists() { return $this->hasMany('App\ClaimInList', 'list_claim_id', 'claim_id'); } /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function claimTags() { return $this->hasMany('App\ClaimTag', null, 'claim_id'); } /** * Get claim content tag from content type * @return string */ public function getContentTag() { $contentTag = null; if ($this->type == "channel") { return 'channel'; } elseif ($this->type == "claimreference") { return 'support'; } elseif ($this->type == "claimlist") { return 'list'; } else { if (substr($this->content_type, 0, 5) === 'audio') { return 'audio'; } else if (substr($this->content_type, 0, 5) === 'video') { return 'video'; } else if (substr($this->content_type, 0, 5) === 'image') { return 'image'; } else if ($this->content_type === 'application/pdf') { return 'pdf'; } else { return 'document'; } } } }