title: Setting SQLite as my database in laravel 5
body: <p>I'm creating a small mockup for a social network in Laravel 5. I want to use SQLite as my database to keep things small and local. I'm having some trouble, however, getting it to work.</p>
  
  <p>Here's my code (using blade) where I just use a table to display a row in the database: </p>
  
  <pre><code>@extends('layouts.master')
  
  @section('title')
      Testing2
  @stop
  
  @section('content')
  This is a second test
  &lt;a href="/"&gt;Back to page 1&lt;/a&gt;
  
  &lt;table&gt;
      &lt;tr&gt;&lt;th&gt;Author&lt;/th&gt;
          &lt;th&gt;Text&lt;/th&gt;&lt;/tr&gt;
      @foreach($posts as $post)
          &lt;tr&gt;
              &lt;td&gt;
                  {{$posts-&gt;Author}}
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  {{$posts-&gt;Text}}
              &lt;/td&gt;
          &lt;/tr&gt;
      @endforeach
  &lt;/table&gt;
  @stop
  </code></pre>
  
  <p>"Author" and "Text" being 2 columns in my database. Here is the Route I use to generate the page:</p>
  
  <pre><code>Route::get('test2', function () {
      $sql = "select * from Posts";
      $posts = DB::select($sql);
      return View::make('test2')-&gt;withPosts($posts);
  });
  </code></pre>
  
  <p>I know my database is there, I've placed it in the /database directory of my app:</p>
  
  <p><a href="https://i.stack.imgur.com/ZgVW2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZgVW2.png" alt="enter image description here"></a></p>
  
  <p>Lastly, I modified the config\database.php file to set SQLite as the default database:</p>
  
  <p><a href="https://i.stack.imgur.com/GyiDB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GyiDB.png" alt="enter image description here"></a></p>
  
  <p>When I try and view the blade page using the Route function, I get the following error: "SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it."</p>
  
  <p>I'm doing something wrong somewhere with connecting to my database, but I don't know what. Have I set it up properly?</p>