title: Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager
body: <p>I am trying to implement Laravel without templates in a minimal fashion. Actually I would like to migrate a Non-Laravel project and do it step by step.</p>
  
  <pre><code>require_once __dir__ . '/../vendor/autoload.php';
  
  $app = new Application($_ENV['APP_BASE_PATH'] ?? dirname(__DIR__));
  
  $app-&gt;singleton(
      Illuminate\Contracts\Http\Kernel::class,
      App\Kernel::class
  );
  
  $app-&gt;singleton(
      Illuminate\Contracts\Debug\ExceptionHandler::class,
      App\Exceptions\Handler::class
  );
  
  $kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class);
  
  $request = \Illuminate\Http\Request::capture();
  $app-&gt;instance('request', $request);
  
  $app-&gt;bootstrapWith($this-&gt;bootstrappers);
  
  $app-&gt;boot();
  </code></pre>
  
  <p>Everything works fine except for the bootstrapper:</p>
  
  <pre><code>\Illuminate\Foundation\Bootstrap\RegisterProviders::class,
  </code></pre>
  
  <p>Which will load <code>Illuminate\Support\Manager</code>. By digging a bit I found that <code>Manager</code>'s constructor is: </p>
  
  <pre><code>public function __construct($app)
  {
      $this-&gt;app = $app;
  }
  </code></pre>
  
  <p>And Laravel cannot resolve the dependencies of <code>$app</code>. However if I monkey patch this constructor with the following, then it works. </p>
  
  <pre><code>public function __construct(\Illuminate\Foundation\Application $app)
  </code></pre>
  
  <p>How does Laravel resolve the dependency injection for <code>$app</code> and why isn't working in my case?</p>