Get single field value in drupal 8

getting entity field values programmatically is easy, but check this out. With this snippet you get the value directly of a single field value:

$entity->get("fieldName")->getString();

 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!