title: Get id from laravel array with multiple id's
body: <p>im trying to fetch multiple Id's from one array for then using it on a query relationship.
  This is what I tried:</p>
  
  <pre><code>    $following = $user-&gt;following;
      $followingId = $following-&gt;id;
  </code></pre>
  
  <p>I get this error: </p>
  
  <pre><code>'Undefined property: Illuminate\Database\Eloquent\Collection::$id'
  </code></pre>
  
  <p>If I log $following, I get the following array, as you can see I'm following 4 different users and I need to get those id's:</p>
  
  <pre><code>local.INFO: [{"id":32,"email":"test@mail.com","username":"test@mail.com","photo":"97dfebf4098c0f5c16bca61e2b76c373","cover_photo":"default-no-image.jpg","last_access":null,"activation_code":null,"is_sponsor":0,"is_admin":0,"displayname":null,"followers_amount":1,"winwins_amount":1,"pivot":{"follower_id":1,"followed_id":32}},{"id":69,"email":"fhamada@paginar.net","username":"fhamada@paginar.net","photo":"placeholder-square.jpg","cover_photo":"default-no-image.jpg","last_access":null,"activation_code":null,"is_sponsor":0,"is_admin":0,"displayname":null,"followers_amount":1,"winwins_amount":0,"pivot":{"follower_id":1,"followed_id":69}},{"id":79,"email":"sandrastun@gmail.com","username":"sandrastun@gmail.com","photo":"placeholder-square.jpg","cover_photo":"default-no-image.jpg","last_access":null,"activation_code":null,"is_sponsor":0,"is_admin":0,"displayname":null,"followers_amount":1,"winwins_amount":0,"pivot":{"follower_id":1,"followed_id":79}},{"id":101,"email":"cristobalalfonzo@outlook.com","username":"cristobalalfonzo@outlook.com","photo":"placeholder-square.jpg","cover_photo":"default-no-image.jpg","last_access":null,"activation_code":null,"is_sponsor":0,"is_admin":0,"displayname":null,"followers_amount":1,"winwins_amount":0,"pivot":{"follower_id":1,"followed_id":101}}]  
  </code></pre>
  
  <p>Query relationship:</p>
  
  <pre><code>$activities = DB::table('notifications')
                  -&gt;join('users', 'users.id', '=', 'notifications.sender_id')
                  -&gt;join('followers', 'followed_id', '=', 'users.id')
                  -&gt;join('user_details', 'user_details.id', '=', 'notifications.user_id')
                  -&gt;join('winwins', 'winwins.id', '=', 'object_id')
                  -&gt;leftJoin('groups', 'notifications.object_id', '=', 'groups.id')
              -&gt;where('notifications.sender_id', '=', $user-&gt;id)
              -&gt;orWhere('winwins.id', '=', 'notifications.object_id')
              -&gt;orWhere('sender_id', '=', $user-&gt;id)
              -&gt;orWhere('followers.followed_id', '=', $followingId)
              -&gt;orderBy('sent_at', 'desc')
              -&gt;skip($page * $amount)
              -&gt;take($amount)
  </code></pre>