title: How to pass multi array to composer laravel
body: <p>I'm trying to pass 2 arrays to a base view in laravel but I can't find the way to figure it out. It works well with 1 array, but can't with 2 arrays.
  I have a sidebar for a commercer website, which will display list of catetogories and list of shops. I use composer to handle it as a base view, but I can't pass 2 arrays of categories and shops.
  This is my composer class:</p>
  
  <pre><code>class SidebarComposer
  {
  
      public function compose(View $view)
      {
          $categories = array();
          $categories[0] = "Cate 1";
          $categories[1] = "Cate 2";
          $categories[2] = "Cate 3";
          $categories[3] = "Cate 4";
          $categories[4] = "Cate 5";
          $categories[5] = "Cate 6";
  
          $shops = array();
          $shops[0] = "Shop 0";
          $shops[1] = "shops 1"
  
          $view-&gt;with('categories',$categories)-&gt;with('shops',$shops);
      }
  }
  </code></pre>
  
  <p>Here is my view (sidebar.blade.php)</p>
  
  <blockquote>
  <pre><code>@for ($i = 0; $i &lt; count($categories); $i++)
      &lt;div class="panel panel-default"&gt;
      &lt;div class="panel-heading"&gt;
        &lt;h4 class="panel-title"&gt;&lt;a href=""&gt;{{$categories[$i]}}&lt;/a&gt;&lt;/h4&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endfor
  @for ($i = 0; $i &lt; count($shops); $i++)
              &lt;li&gt;&lt;a href="{{url('')}}"&gt; &lt;span class="pull-right"&gt;&lt;/span&gt;{{$shops[$i]}}&lt;/a&gt;&lt;/li&gt;
  @endfor
  </code></pre>
  </blockquote>
  
  <p>I have no experiences with laravel. Please help me, thanks very much.</p>