Nested view not receiving data from controller in Laravel 5.1
<p>From the documentation the way we pass data from controller to view in laravel is like</p>

<pre><code>return view('someview')-&gt;with('key', $data);
</code></pre>

<p>So I try to pass my query results to view by</p>

<pre><code>$data = DB::table('user')-&gt;where('confirmation_status',1)-&gt;get();
return view('admin.presidentConfirmed')-&gt;with('data',$data);
</code></pre>

<p>But at the presidentConfirmed view, there's no data in it.
So I tried to use <code>{{ Session::all() }}</code> to see if there's anything in the session.</p>

<p>Nothing...</p>

<p>So I tried passing just plain text through with</p>

<p><code>return view('admin.presidentConfirmed')-&gt;with('test','value');</code></p>

<p>Still nothing...</p>

<p>It's seems to only happen to only this specific view. Since I use <code>-&gt;with()</code> with many other views without any problem.</p>

<p><strong>presidentConfirmed</strong></p>

<pre><code>@extends('layout.main')

@section('content')

@stop
</code></pre>

<p><strong>layout.main</strong></p>

<pre><code>@include('layout/component.menu')

&lt;div class="container" id="main_container"&gt;
  &lt;div class="well"&gt;
    @yield('content')
  &lt;/div&gt;
  @if(Config::get('app.debug') == true)
    &lt;div class="well"&gt;
      {{ var_dump(Session::all()) }}
    &lt;/div&gt;
  @endif
&lt;/div&gt;
&lt;script src="/js/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="/js/bootstrap.min.js"&gt;&lt;/script&gt;
@yield('script')
@if(Config::get('applicationConfig.release') == 'release' &amp;&amp; Config::get('applicationConfig.mode') != 'close' &amp;&amp; Config::get('applicationConfig.mode') != 'technical_difficulties')
&lt;script&gt;
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-73122311-1', 'auto');
  ga('send', 'pageview');

&lt;/script&gt;
@endif
</code></pre>