title: Passing multiple arrays to the view in Laravel 8
body: <p>I am trying to pass multiple arrays to the blade file using the following statement.</p>
  <pre class="lang-php prettyprint-override"><code>public function index()
  {
      $locations = \App\Models\Location::all();
      $peopletypes = config('peopletypes');
      $eventtypes = config('eventtypes');
  
      return view('home')-&gt;with(compact(['locations' =&gt; $locations,
          'peopletypes' =&gt; $peopletypes,
          'eventtypes' =&gt; $eventtypes])); // tried removing compact also
  }
  </code></pre>
  <p>In the HTML, I am trying to access the following way.</p>
  <pre class="lang-php prettyprint-override"><code>@foreach($eventtypes as $eventtype)
      &lt;a class=&quot;dropdown-item ml-2&quot; 
          id=&quot;{{ $eventtype['value'] }}&quot; href=&quot;#&quot;&gt;{{ $eventtype['name'] }}
      &lt;/a&gt;
  @endforeach
  </code></pre>
  <p>It is still saying that <code>$eventtypes</code> is undefined. Can anyone please tell me what is wrong here?</p>