title: Use Laravel features outside of it
body: <p>Assume I have test.php file inside public folder. I want to read a table and dump it.</p>
  
  <pre><code>require "../vendor/autoload.php";
  
  use Illuminate\Support\Facades\DB;
  use Illuminate\Support\Str;
  
  
  $links = DB::select('select * from tbl_links ' );
  dd($links);
  </code></pre>
  
  <p>Now I go to mydomain.ir/load.php .</p>
  
  <blockquote>
    <p>Fatal error: Uncaught RuntimeException: A facade root has not been
    set. in
    /home/dastanez/zanganli.ir/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258
    Stack trace: #0 /home/dastanez/zanganli.ir/public/load.php(8):
    Illuminate\Support\Facades\Facade::__callStatic('select', Array) #1
    {main} thrown in
    /home/dastanez/zanganli.ir/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php
    on line 258</p>
  </blockquote>
  
  <p>How can I fix this? Thank you.</p>