public function hasTag($tag): bool
    {
        if ($tag instanceof Tag) {
            $normalized = $tag->getAttribute('normalized');
        } else {
            $normalized = app(TagService::class)->normalize($tag);
        }

        return in_array($normalized, $this->getTagArrayNormalizedAttribute(), true);
    }
public function hasTag($tag): bool
    {
        if ($tag instanceof Tag) {
            $normalized = $tag->getAttribute('normalized');
        } else {
            $normalized = app(TagService::class)->normalize($tag);
        }

        return in_array($normalized, $this->getTagArrayNormalizedAttribute(), true);
    }
public function hasTag ( $ tag ) : bool { if ( $ tag instanceof Tag ) { $ normalized = $ tag -> getAttribute ( 'normalized' ) ; } else { $ normalized = app ( TagService :: class ) -> normalize ( $ tag ) ; } return in_array ( $ normalized , $ this -> getTagArrayNormalizedAttribute ( ) , true ) ; }
Determine if a given tag is attached to the model.

@param Tag|string $tag

@return bool
Determine if a given tag is attached to the model .