public function tags()
{
$tags = $this->refs()->where('is_tag', true)->lists('name')->toArray();
$compare = new VersionCompare();
// Sort the tags, if compare throws an exception it isn't a value version string so just do a strnatcmp
@usort($tags, function ($first, $second) use($compare) {
try {
return $compare->compare($first, $second);
} catch (UnexpectedValueException $error) {
return strnatcmp($first, $second);
}
});
return collect($tags);
}