title: Laravel 5.3 : hidden fields are returned in JSON response
body: <p>First of all I've searched the web for an answer and could not find any which quite astonished me. Maybe I did not search for the right terms, please excuse me in advance if this is the case.</p>
  
  <p>So I defined in my model some fields as hidden :</p>
  
  <pre><code>protected $hidden = [
      'hasExpired', 'hasBeenTreated', 'reporterId'
  ];
  </code></pre>
  
  <p>And this is how I output the results :</p>
  
  <pre><code>return response()-&gt;json([
           'latestReports' =&gt; $latestReports
         ]);
  </code></pre>
  
  <p>And the $latestReports variable is defined somewhere else as :</p>
  
  <pre><code>$query = DB::table('reports')
              -&gt;where('catId', 0) ;
  
  $latestReports = $query-&gt;where('hasExpired', 0)
              -&gt;orderBy('created_at', 'desc')
              -&gt;get();
  </code></pre>
  
  <p>How on earth is it possible that these fields still appear in the response I get on the client from the server, and above all what should I correct to prevent them from appearing. In other word how can I make the hidden array be enforced ? </p>
  
  <p>Please note: for some other models (e.g. users) the hidden array is enforced, that is the hidden fields do not appear in the response.</p>
  
  <p>Any help appreciated.</p>