title: Access Request in Service Provider After Applying Middleware
body: <h1>Bindings</h1>
  
  <p>I'm using bindings in my service provider between interface and implementation:</p>
  
  <pre><code>public function register()
  {
      $this-&gt;app-&gt;bind('MyInterface', MyImplementation::class);
  }
  </code></pre>
  
  <h1>Middleware</h1>
  
  <p>In my middleware, I add an attribute to the request:</p>
  
  <pre><code>public function handle($request, Closure $next)
  {
      $request-&gt;attributes-&gt;add(['foo' =&gt; 'bar]);
      return $next($request);
  }
  </code></pre>
  
  <h1>Now, I want to access <code>foo</code> in my service provider</h1>
  
  <pre><code>public function register()
  {
      $this-&gt;app-&gt;bind('MyInterface', new MyImplementation($this-&gt;request-&gt;attributes-&gt;get('foo')); // Request is not available
  }
  </code></pre>
  
  <h1>The register() is called before applying the middleware. I know.</h1>
  
  <p>I'm looking for a technique to 'rebind' if the request->attributes->get('foo') is set</p>