get taxonomy term aliased path when its a referenced field in a $node entity what I have is a $node and know how to get its aliased URL but I also have a field field_category that I know how to get the name but how do I get the url alias for it 

$nid = 1;
$node = \Drupal\node\Entity\Node::load($nid);
$options = ['absolute' =&gt; TRUE];
$nodeurl = \Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' =&gt; $nid], $options);
$categoryname = $node-&gt;field_category[0]-&gt;entity-&gt;label();
Sure enough I could use the tid or target_id in entity reference lingo and use it to find the URL fromRoute using as route_name entity.taxonomy_term.canonical 

    $tid = $node-&gt;field_category[0]-&gt;target_id;
    $categoryurl = \Drupal\Core\Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' =&gt; $tid], $options);


find other taxonomy route_names 

might also need to see the Url::fromRoute definition