title: Is it possible to use Laravel Facades with Illuminate Database Standalone?
body: <p>I'm following this <a href="https://github.com/illuminate/database/blob/master/README.md" rel="nofollow noreferrer">README</a> and am curious if it's possible to get the following to work:</p>
  
  <pre><code>$capsule = new Illuminate\Database\Capsule\Manager;
  
  $capsule-&gt;addConnection([
      'driver'    =&gt; 'mysql',
      'host'      =&gt; 'localhost',
      'database'  =&gt; 'database',
      'username'  =&gt; 'root',
      'password'  =&gt; 'password',
      'charset'   =&gt; 'utf8',
      'collation' =&gt; 'utf8_unicode_ci',
      'prefix'    =&gt; '',
  ]);
  
  $capsule-&gt;setAsGlobal();
  $capsule-&gt;bootEloquent();
  
  # can Facades be used like this somehow?
  var_dump(DB::connection()-&gt;getPdo());
  var_dump(Hash::make('hash'));
  </code></pre>
  
  <p>I get the following error which is expected because the scripts not loading any Facades but I'm not sure how to tweak things to work:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'DB' not found
  </code></pre>
  
  <p>I've also tried out the accepted answer <a href="https://stackoverflow.com/questions/30053695/how-to-create-illuminate-support-facade-app-facade-for-standalone-illuminate-ioc">here</a> but still no luck (not even sure I'm using it correctly?)..</p>
  
  <pre><code>$container = new Illuminate\Container\Container();
  Illuminate\Support\Facades\Facade::setFacadeApplication($container);
  $container-&gt;singleton('db', 'Illuminate\Support\Facades\DB');
  class_alias('Illuminate\Support\Facades\DB', 'DB');
  </code></pre>
  
  <p>Which gives me the following error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\DB::connection()
  </code></pre>
  
  <p>Adding "use DB;" up top still gives the following error:</p>
  
  <pre><code>Fatal error: Uncaught Error: Class 'DB' not found
  </code></pre>
  
  <p>Adding "use Illuminate\Support\Facades\DB;" up top gives the following error:</p>
  
  <pre><code>Fatal error: Uncaught RuntimeException: A facade root has not been set.
  </code></pre>
  
  <p>Any suggestions? Or is it just that Facades cannot be used with Illuminate Database standalone?</p>