drupal 8 get entity from url code example Example: drupal 8 get url from node entity $entity->toUrl()->toString();