@AlexVanderbist on twitter shares this nice shorthand using the modelKeys
method to returns the primary keys for all models in the collection.
//instead of this
$product->attributes->pluck('id')->toArray();
//You can use
$product->attibutes->modelKeys();