title: Laravel not Return controller variable error
body: <p>i`m going to draw a chart and also fetch data in a same view.so that this is the controller .</p>
  
  <pre><code>public function division_details()
  {
  
       $items = registerdetails::whereDate('start_date', '&lt;=', date('Y-m-d'))-&gt;whereDate('end_date', '&gt;=', date('Y-m-d'))-&gt;get();
  
    $chart = Charts::database(registerdetails::whereDate('start_date', '&lt;=', date('Y-m-d'))-&gt;whereDate('end_date', '&gt;=', date('Y-m-d'))-&gt;get(), 'bar', 'highcharts')
          -&gt;title("Active Trainne Working Divisions")
          -&gt;responsive(false)
          -&gt;Width(0)
          -&gt;groupBy('trainee_division');
      return view('registeredusers.divisiondetails', compact('items'),['chart' =&gt; $chart]);
  }
  </code></pre>
  
  <p>so that i called that items variable in a view so that from this controller items variable not returning so that um getting this error in called view.<a href="https://i.stack.imgur.com/LFqKB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LFqKB.jpg" alt="enter image description here"></a></p>
  
  <p>can anyone suggest me the correct code correction.</p>