title: Add data into laravel object
body: <p>so i have this kind of class from my user controller</p>
  
  <pre><code>public function index()
      {
          $table_data = User::with('CU','pus')-&gt;select('id','id_cu','id_pus','name','username','gambar','status','created_at')-&gt;filterPaginateOrder();
  
          return response()
              -&gt;json([
                  'model' =&gt; $table_data
              ]);
      }
  </code></pre>
  
  <p>it is using trait called <code>filterPaginateOrder</code> and the end result that i receive are:</p>
  
  <pre><code>{
    "model": {
      "current_page": 1,
      "data": [
        {
          "id": 8,
          "id_cu": 0,
          "id_pus": 1,
          "name": "test1",
          "username": "test17",
          "gambar": "",
          "status": 1,
          "created_at": "2018-02-27 06:37:10",
          "c_u": null,
          "pus": {
            "id": 1,
            "name": "Puskopdit BKCU Kalimantan"
          }
        },
        {
          "id": 1,
          "id_cu": 0,
          "id_pus": 1,
          "name": "tony",
          "username": "t0n1zz",
          "gambar": null,
          "status": 1,
          "created_at": "2017-01-01 11:11:11",
          "c_u": null,
          "pus": {
            "id": 1,
            "name": "Puskopdit BKCU Kalimantan"
          }
        }
      ],
      "from": 1,
      "last_page": 1,
      "next_page_url": null,
      "path": "https://bkcuvue.dev/api/v1/user",
      "per_page": "2",
      "prev_page_url": null,
      "to": 2,
      "total": 2
    }
  }
  </code></pre>
  
  <p>so what if i want to add some data into it? inside <code>data</code> array for each array i want to add <code>"role":"master"</code> how do i do that?</p>
  
  <p>i tried <code>$table_data-&gt;push('role','master')</code> and <code>$table_data-&gt;put('role','master')</code> from reading about collection (those query in laravel return collection right?) but none of those code working...</p>