Generate node edit link
Given a node or node id is there a way to generate an admin edit link to its edit form?


Absolutely, the Url class has a fromRoute method:

$url = Url::fromRoute('entity.node.edit_form', ['node' =&gt; $nid]);
$link = Link::fromTextAndUrl('edit', $url);
$build = [
  ...
  'link' =&gt; $link-&gt;toRenderable(),
];