title: How to return multiple views in one function in laravel for same route
body: <p>it is quite difficult to explain my question. I hope you will be able understand it. </p>
  
  <p>For my project I have a master layout which contains the header and yield of content.</p>
  
  <p><em>master.blade.php</em></p>
  
  <pre><code> @include('partials.header')
      &lt;div class="container-fluid main-con"&gt;
          @yield('content')
          @include('partials.footer')
      &lt;/div&gt;  
  </code></pre>
  
  <p>now on main public route I am raturning a method.</p>
  
  <p><em>Web.php</em></p>
  
  <pre><code>Route::get('/', [
      'uses' =&gt; 'ProductContoller@getIndex',
      'as' =&gt; 'product.mainCats'
  ]);
  </code></pre>
  
  <p><em>ProductContoller.php</em></p>
  
  <pre><code>class ProductContoller extends Controller
  {
  
      public function getIndex(){
          $ad_cats = Mainaddtype::orderBy('title')-&gt;get();
          return view( 'shop.main-categories-page', ['mediacats' =&gt; $ad_cats]);
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Now my query is, 'main-categories-page' is yielding in content section of master. but I want the same data of Mainadtype in header also. So I want to return view of header on same function. Please help if u understand it.</p>
  
  <p>what I am trying now is,</p>
  
  <pre><code> public function getIndex(){
          $ad_cats = Mainaddtype::orderBy('title')-&gt;get();
          return view( 'shop.main-categories-page', ['mediacats' =&gt; $ad_cats]);
          return view( 'partials.header', ['mediacats' =&gt; $ad_cats]);
      }
  </code></pre>
  
  <p>But I know we cant return in this way.
  Thanks in advance. </p>