title: Laravel: How to modify notifications collection
body: <p>I've got a function which returns <a href="https://laravel.com/docs/5.6/notifications#accessing-the-notifications" rel="nofollow noreferrer">database notifications</a> of a user (the User model is <a href="https://laravel.com/docs/5.6/notifications#sending-notifications" rel="nofollow noreferrer">Notifiable</a>):</p>
  
  <pre><code>return $user-&gt;notifications()-&gt;get();
  </code></pre>
  
  <p>The result returned is like this:</p>
  
  <pre><code>[
      {
          "id": "5d6548d3-1f9b-4da5-b332-afbf428df775",
          "type": "Meysam\\Notification\\Classes\\CommentCreated",
          "notifiable_id": 1,
          "notifiable_type": "RainLab\\User\\Models\\User",
          "data": {
              "userId": 2,
              "commentId": 18
          },
          "read_at": null,
          "created_at": "2018-03-05 09:58:34",
          "updated_at": "2018-03-05 09:58:34"
      },
      {
          "id": "2e22e24e-a972-4a30-afeb-0049a40966a7",
          "type": "Meysam\\Notification\\Classes\\CommentCreated",
          "notifiable_id": 1,
          "notifiable_type": "RainLab\\User\\Models\\User",
          "data": {
              "userId": 3,
              "commentId": 17
          },
          "read_at": null,
          "created_at": "2018-03-05 09:38:38",
          "updated_at": "2018-03-05 09:38:38"
      }
  ]
  </code></pre>
  
  <p>What's the best way to modify this collection before returning it? For example, I want to remove the <code>"id"</code> field from objects, change the value of <code>"type"</code> field to <code>"CommentCreated"</code>, and add new fields like <code>"url", "username", "email", etc</code> to each item. Is it a good idea to add <code>hidden</code>, <code>visible</code> and <code>append</code> <a href="https://laravel.com/docs/5.6/eloquent-serialization#appending-values-to-json" rel="nofollow noreferrer">attributes</a> to <code>DatabaseNotification</code> model class (if so, how)? Are <a href="https://laravel.com/docs/5.6/eloquent-resources" rel="nofollow noreferrer">API Resources</a> useful here?</p>