What to replace entity_uri() with in Drupal 8? So I have the following code in my Drupal 7 module:

$uri = entity_uri('node', $node);
$breadcrumb[] = l($node-&gt;title, $uri['path'], $uri['options']);


Anyone know how to convert the above code to Drupal 8?

Since l() is depreciated, I believe the second line should be replaced as follows:

$breadcrumb = array(Link::createFromRoute($node-&gt;title, $uri['path'], $uri['options']));


I'm struggling with what to do with entity_uri() since the change records don't really indicate how that function is to be replaced.

Note: this is being used within the BreadcrumbBuilderInterface class.
Try with this code:

$link = $node-&gt;toLink($node-&gt;getTitle(), 'canonical', $options);


Get more information about Node object here: "Node Object"