title: Dynamically access array in Laravel Blade
body: <p>I have an issue dynamically accessing an array in one of my views.</p>
  
  <p>I begin by organizing the values I need easy access to into <code>$entityClubStats</code> like this:</p>
  
  <pre><code>$entityClubStats = [];
  foreach($entity-&gt;clubs as $club) {
      $entityClubStats[$club-&gt;name] = [
          'days_to_pay' =&gt; $club-&gt;pivot-&gt;days_to_pay,
          // ...
      ];
  }
  </code></pre>
  
  <p>Then I iterate the master list of clubs with the intent of filling in relevant values if they exist:</p>
  
  <pre><code>@foreach (Club::isIncludedInStats()-&gt;get() as $club)
  &lt;div&gt;
      &lt;label&gt;Name&lt;/label&gt;
      &lt;input type="text" value="{{$club-&gt;name}}" readonly /&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;label&gt;Days to Pay&lt;/label&gt;
      &lt;input type="text" name="club_days_to_pay" value="{{$entityClubStats[$club-&gt;name]['days_to_pay']}}" /&gt;
  &lt;/div&gt;
  &lt;!-- ... --&gt;
  @endforeach
  </code></pre>
  
  <p>The problem is that while I've tried using <code>{{double_brackets}}</code> and <code>&lt;?= standard_syntax ?&gt;</code>, this segment results in a white screen:</p>
  
  <p><code>$entityClubStats[$club-&gt;name]['days_to_pay'];</code></p>
  
  <p>However, it <em>does</em> work when I simply hardcode the <code>$club-&gt;name</code>:</p>
  
  <p><code>$entityClubStats['AAA']['days_to_pay'];</code></p>
  
  <p>Why?</p>