Skip to content

Instantly share code, notes, and snippets.

@keepanitreel
Created December 2, 2016 05:03
Show Gist options
  • Save keepanitreel/ddeaaae0f55816c4ad9e72da6a8c868c to your computer and use it in GitHub Desktop.
Save keepanitreel/ddeaaae0f55816c4ad9e72da6a8c868c to your computer and use it in GitHub Desktop.
$array_collection = collect(
[
['id'=>"1"],
['id'=>"2"],
['id'=>"3"]
]
);
$object1 = new \stdClass();
$object1->id = '1';
$object2 = new \stdClass();
$object2->id = '2';
$object3 = new \stdClass();
$object3->id = '3';
$object_collection = collect(
[
$object1,
$object2,
$object2
]
);
dump($array_collection->first()['id'], $object_collection->first()->id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment