title: Filter attributes in Laravel Resource Collection
body: <p>In the new Laravel Resource classes, you are able to remove attributes based on anything you like.</p>
  
  <p>If you want to return many items, you can use the function </p>
  
  <pre><code>Resource::collection()
  </code></pre>
  
  <p>But that does not let you add metadata in one place. Enter a Collection, great, this is many items in a nice format with the ability to add meta data. What you cannot do though, is filter the collection you have to hide attributes like you can with a resource. The only way I can see to do it is</p>
  
  <pre><code>foreach ($this-&gt;collection as $item) {
          if ($notAdmin) {
              $temp = array_except($item-&gt;toArray(), ['secret']);
          }
          $temp['links'] = ['self' =&gt; route('restaurant.show', [$item])];
          $data[] = $temp;
      }
  </code></pre>
  
  <p>Is there something I am missing? This seems like a massive overlooked ability for a Resource Collection</p>