title: laravel passing database array from controller to view
body: <p>hello people here is my code below for <code>controller</code></p>
  
  <pre><code>$siteinformation = DB::table('siteinformation')-&gt;where('Site',$myarr[0]['site'])-&gt;select()-&gt;get();
  
  print_R($siteinformation); will display
  
  Array ( [0] =&gt; stdClass Object ( [Site] =&gt; site1 [Nickname] =&gt; friend [ProgramID] =&gt; 1 [CreateDateTime] =&gt; 2014-06-03 18:05:39 ) )
  </code></pre>
  
  <p>I am trying to pass it to view </p>
  
  <pre><code>return Redirect::to('sbs_site')-&gt;with('siteinformation',$siteinformation);
  </code></pre>
  
  <p>In my view i have...</p>
  
  <pre><code>@if(Session::has('siteinformation'))
  @foreach ($siteinformation as $key =&gt; $value) 
  
  {{ $value-&gt;Nickname }}
  
  @endforeach
      @endif
  </code></pre>
  
  <p>Iam gettng an error <code>Undefined variable: siteinformation</code> </p>
  
  <p>my route file contains... <code>Route::post('sbs_site', array('uses' =&gt; 'myController@sys_config'));</code></p>
  
  <p>what could be the problem??</p>