title: How to use method injection with App::call in Laravel
body: <p>I am using Laravel 5.2 and wrote my own Service Provider. I want to inject a <em>Request</em> object into the register method. </p>
  
  <p>The base problem is that I want to call different service container depending on a special request param - all the service container implementing the same interface/contract of course.</p>
  
  <p>The error message I am getting is:</p>
  
  <pre><code>ReflectionException in Container.php line 559:
  Function registerService() does not exist
  </code></pre>
  
  <p>My service provider looks like that:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace App\Providers;
  
  use Illuminate\Http\Request;
  use Illuminate\Support\ServiceProvider;
  use App\Contracts\Extractor;
  
  class ExtractorServiceProvider extends ServiceProvider
  {
      /**
       * Indicates if loading of the provider is deferred.
       *
       * @var bool
       */
      protected $defer = true;
  
      /**
       * Available services for channels
       *
       * @var array
       */
      protected $availableServices = ['AExtractor', 'ZExtractor'];
  
      /**
       * Bootstrap any application services.
       *
       * @return void
       */
      public function boot()
      {
          //
      }
  
      /**
       * Register any application services.
       *
       * @return void
       */
      public function register()
      {
          $this-&gt;app-&gt;call('registerService');
      }
  
      /**
       * @param Request $request
       * @return void
       */
      protected function registerService(Request $request)
      {
          $tag = DB::table('channels')-&gt;where('id', $request-&gt;channel)-&gt;value('tag')-&gt;first()-&gt;tag;
  
          $selectedExtractor = $tag . 'Extractor';
          $extractor = 'AExtractor';
  
          if(in_array($selectedExtractor, $this-&gt;availableServices)) {
              $extractor = $selectedExtractor;
          }
  
          $this-&gt;app-&gt;bind('App\Contracts\Extractor', "App\\Helpers\\{$extractor}");
      }
  
      /**
       * Get the services provided by the provider.
       *
       * @return array
       */
      public function provides()
      {
          return [Extractor::class];
      }
  }
  </code></pre>
  
  <p>How can I use <code>$this-&gt;app-&gt;call('registerService');</code> to call my <code>registerService</code> function and inject the <em>Request</em> object?</p>