title: Converting a date to a carbon instance from query results
body: <p>I was recently adding some functionality to a moderation queue that I have. Instead of querying one table, Questionnaire, it is now querying Users to so that I can grab their username.</p>
  
  <p>My previous query was just</p>
  
  <pre><code>$questionnaire = Questionnaire::all();
  </code></pre>
  
  <p>And then when I accessed this on the page I could format it like so:</p>
  
  <pre><code>{{ $questionnaire-&gt;created_at-&gt;format('F d, Y h:ia') }}
  </code></pre>
  
  <p>This is how my new query looks in my controller:</p>
  
  <pre><code>public function moderate()
      {
          $questionnaires = DB::table('users')
                          -&gt;join('questionnaire', 'users.id', '=', 'questionnaire.memberid')
                          -&gt;select('users.username', 'questionnaire.*')
                          -&gt;get();
          return view('questionnaire.moderate', ['questionnaires' =&gt; $questionnaires]);
      }
  </code></pre>
  
  <p>However when I try to access the <code>created_at</code> date on the page now I get a <code>Call to a member function format() on a non-object</code> error. My digging leads me to believe this is because the date isn't converted to a carbon instance. </p>
  
  <p>However all the documentation on Carbon is for when you're just pulling the date and I'm struggling to figure out how to convert it after I get the query results so that I can still access it on the page.</p>
  
  <p>Can anyone hel?</p>