title: Anonymous Blade Component - Rendering slot variable to function yields array_key_exists(): The first argument should be either a string or an integer
body: <p>Laravel 7.X</p>
  <p>I've created a simple anonymous input blade component that includes validation error output.  It was a translation of a previously working template.</p>
  <p>The component is as follows:</p>
  <pre><code>&lt;div class=&quot;form-group&quot;&gt;
      &lt;label for='{{$field}}'&gt;{{$title}} @error($field) - &lt;span class='text-danger'&gt; {{ $message }} &lt;/span&gt; @enderror &lt;/label&gt;
      &lt;input id='{{$field}}' name='{{$field}}' type=&quot;text&quot; class='form-control{{ $errors-&gt;has($field) ? ' is-invalid' : '' }}' placeholder='{{$placeholder}}' {{$attributes}} value='{{ old($field, $value) }}' &gt;
  &lt;/div&gt;
  </code></pre>
  <p>In the view, I do the following:</p>
  <pre><code>&lt;x-input-validation autofocus onblur=&quot;validate()&quot;&gt;
      &lt;x-slot name=&quot;field&quot;&gt;name&lt;/x-slot&gt;
      &lt;x-slot name=&quot;title&quot;&gt;Name&lt;/x-slot&gt;
      &lt;x-slot name=&quot;placeholder&quot;&gt;Add Name&lt;/x-slot&gt;
      &lt;x-slot name=&quot;value&quot;&gt;{{$app-&gt;name}}&lt;/x-slot&gt;
  &lt;/x-input-validation&gt;
  </code></pre>
  <p>During rendering, I receive the following error message:</p>
  <pre><code>array_key_exists(): The first argument should be either a string or an integer (View: C:\wamp64\www\DE\resources\views\components\input-validation.blade.php)
  </code></pre>
  <p>The problem seems to be related to the @error($field) directive and the old($field, $value) function.  If I change these to remove the $field variable, it will render.</p>
  <p>It also seems to work, unaltered, if there are no validation errors present, or if there aren't previous values stored in the session.  It renders properly under this situation, too.</p>
  <p>After many tries, one tidbit seems to be that the $field variable is of type HTMLString.  Not sure if this is a red herring or not, but given it's complaining about type, I'm assuming that's the source of the problem.</p>
  <p>Any ideas how I should correct this issue?  I'm stumped.</p>
  <p>Thanks!</p>