title: How to send variables to master layout in Laravel 4?
body: <p>How to send variables to master layout in Laravel 4 ? </p>
  
  <p>Here $categories is not available in master layout :</p>
  
  <pre><code>protected $layout = 'layouts.master';
  
  public function index()
  {
      $categories = Category::all();
      $data = array('categories' =&gt; $categories);
      $this-&gt;layout-&gt;content = View::make('catalog.categories', $data);
  }
  </code></pre>
  
  <p>My master view :</p>
  
  <pre><code>@yield('content')
  
  @if($categories)
     &lt;h1&gt;TEST&lt;/h1&gt;
  @endif
  </code></pre>
  
  <p><strong>"TEST" doesn't appear !</strong></p>