title: Laravel: Difference between View::share() and View::composer()
body: <p>In relation to the question <a href="https://stackoverflow.com/questions/17645087/laravel-passing-default-variables-to-view">Passing default variables to view</a>, to pass variables available among all views, is there a technical or functional difference between the use of <code>View::composer()</code>:</p>
  
  <pre><code>View::composer('*', function($view) {
      $thundercats = 'Woooooohh!!';
      $view-&gt;with('thundercats', $thundercats);
  })
  </code></pre>
  
  <p>in the <em>filters.php</em> file or the use of <code>View::share()</code> in the <em>BaseController.php</em> file:</p>
  
  <pre><code>public function __construct {
      $thundercats = 'Woooooohh!!';
      View::share('thundercats', $thundercats);
  }
  </code></pre>
  
  <p>I've only recently learned about <code>View::share()</code> and find it exceptionally intruiging although I've already started using the former in another project.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>My first assumption is that the former is a file (<em>filters.php</em>) while the the latter is a class (<em>BaseController.php</em>). With this in mind, I'm guessing a class is much better? Although, I'm not quite sure why at this point. :)</p>