title: Laravel 5: cannot pass data from Middleware to Controller
body: <p>I am sending an ajax request with GET method to a controller</p>
  
  <pre><code>Route::get('test', ['Middleware' =&gt; 'TestFilter', 'uses' =&gt; 'HomeController@index']);
  </code></pre>
  
  <p>The Middleware:</p>
  
  <pre><code>public function handle($request, Closure $next)
  {
      return $next($request); //This does not seem to pass $request to HomeController
  }
  </code></pre>
  
  <p>In the index() method of HomeController I am trying to return $request but the page throws error</p>
  
  <pre><code>'Undefined variable: request' in D:\Apps\apilab\app\Http\Controllers\HomeController.php
  </code></pre>
  
  <p>I am simply returning <code>$request</code> in HomeController</p>
  
  <pre><code>class HomeController extends Controller {
    public function index() {
      return $request;
    }
  }
  </code></pre>
  
  <p>How do I pass the request variable to HomeController@index so that I can continue processing?? I am exhausted of trying various methods...</p>