title: Laravel 5: Global Auth $user variable in all controllers
body: <p>In my BaseController I have this:</p>
  
  <pre><code>public function __construct()
  {
      $user = Auth::user();
      View::share('user', $user);
  }
  </code></pre>
  
  <p>I can access the $user array throughout all of my views but what if I want it to be a global variable available in all of my Controllers?</p>
  
  <p>I have the following working code:</p>
  
  <pre><code>use Auth;
  use DB;
  
  class UsersController extends BaseController
  {
     public function index()
     {
          $user = Auth::user();
          $users = DB::table('users')-&gt;where('user_id', $user-&gt;user_id)-&gt;get();
          return view('pages.users.index', compact('users');
      }
  }
  </code></pre>
  
  <p>I want the $user variable available in all of my controllers and within all of the public functions within each on the controllers but I don't want to have to redeclare "use Auth;" and "$user = Auth::user();"</p>
  
  <p>I tried adding it to a __construct in the BaseController but that didn't seem to work, Undefined $user variable error. Any thoughts? I know it's possible. </p>