title: Laravel how to include a partial in the base controller
body: <p>In my laravel application I am using a <code>Base_Controller</code> class and then extend this class in other controller.</p>
  
  <p>In my app there is a variable which I need to use in all my controller and templates. </p>
  
  <p>This is why I tried to use in my base controller.</p>
  
  <p><code>$this-&gt;layout-&gt;myVar = 'stuff'</code></p>
  
  <p>But when I try use <code>$myVar</code> in my view I am getting an error:
  <code>Creating default object from empty value</code></p>
  
  <p>My base class constructor is something like this:</p>
  
  <pre><code>public function __constructor()
  {
    parent::__construct();
    $this-&gt;layout-&gt;menu = 'stuff';
  }
  </code></pre>
  
  <p>Does anyone have any idea on what is the best way to approach this?</p>