title: Laravel how to pass parameters to controller middleware
body: <p>I'm trying to do something but i cant even imagine how to do it.</p>
  
  <p>To pass parameters to a middlware I'm doing this:  </p>
  
  <pre><code>Route::put('post/{id}', ['middleware' =&gt; 'role:editor', function ($id) {
      //
  }]);  
  </code></pre>
  
  <p>From the laravel documentation.
  Then get the parameter in the handle function...</p>
  
  <p>But laravel suggest to declare the middleware use in the __construct in the Controller, insted in the route.</p>
  
  <p>So...</p>
  
  <pre><code>public function __construct() {
         $this-&gt;middleware('auth');
  }
  </code></pre>
  
  <p>But i dont know how to pass parameters to the Controller.</p>
  
  <p>I would thank any help.</p>