---
title: Evaluator
---

# Evaluator

<div class="documentation__toc"></div>

## Introduction

The evaluator service is a simple class that recursively resolves values from a mixed target.

## Basic Usage

You can evaluate your values by using the `\Anomaly\Streams\Platform\Support\Evaluator` class.

### evaluate

The `evaluate` method evaluates a mixed `value` with the provided `arguments`.

```php
$evaluator = app(\Anomaly\Streams\Platform\Support\Evaluator::class);

$evaluator->evaluate($target, $entry);
```

```twig
{{ value($target, $entry) }}
```

```php
$entry = new Person(['name' =>'Ryan']);

$evaluator->evaluate('{entry.name}', compact('entry'));
// Ryan

$evaluator->evaluate(
    function($entry) {
        return $entry->name;
    },
    compact('entry')
); // Ryan
```

```twig
{{ value('{entry.name}', entry) }}
```

> Evaluation is used heavily in the **build** process for [UI builders](../ui).{.tip}
