title: Confused with a Laravel syntax error: unexpected '.' (seems fine to me)
body: <p>I'm new to Laravel.</p>
  
  <p>I keep getting this syntax error:</p>
  
  <pre><code>Symfony\Component\Debug\Exception\FatalThrowableError
  syntax error, unexpected '.' 
  </code></pre>
  
  <p>The line in question is this:</p>
  
  <pre><code>  $post = .\DB::table('posts')-&gt;where('slug', $slug)-&gt;first();
  </code></pre>
  
  <p>Here's the entire code that is not working:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  class PostsController extends Controller
  
  {
    public function show($slug)
    {
      $post = .\DB::table('posts')-&gt;where('slug', $slug)-&gt;first();
  
      dd($post);
  
       // This was to simulate a database
       // $posts = [
       //   'my-first-post' =&gt; 'Hello This is my first blog post',
       //   'my-second-post' =&gt; 'Hello This is my second blog post',
       // ];
  
       // if it doesn't exist then throw this error:
       if (! array_key_exists($post, $posts)){
         abort(404, 'Sorry, that post was not found.');
       }
  
       // return this view:
        return view('post', [
          'post' =&gt; $posts[$post]
        ]);
    }
  
  }
  </code></pre>
  
  <p>What is it that I am missing here!?</p>
  
  <p>Thanks</p>