src/Traits/MicroServiceCacheTrait.php
protected function getCollectionAttributeCacheKeys(array &$cacheKeys, Cacheable $model, $attribute, $collection)
    {
        foreach ($collection as $item) {
            if (isset($item->id)) {
                $cacheKeys[] = implode(':', [$model->getTable(), $attribute, $item->id]);
            }
        }
    }
protected function getCollectionAttributeCacheKeys(array &$cacheKeys, Cacheable $model, $attribute, $collection)
    {
        foreach ($collection as $item) {
            if (isset($item->id)) {
                $cacheKeys[] = implode(':', [$model->getTable(), $attribute, $item->id]);
            }
        }
    }
protected function getCollectionAttributeCacheKeys ( array & $ cacheKeys , Cacheable $ model , $ attribute , $ collection ) { foreach ( $ collection as $ item ) { if ( isset ( $ item -> id ) ) { $ cacheKeys [ ] = implode ( ':' , [ $ model -> getTable ( ) , $ attribute , $ item -> id ] ) ; } } }
Get the attribute cache keys from a collection attribute.

@param array $cacheKeys
@param Cacheable $model
@param $attribute
@param $collection
Get the attribute cache keys from a collection attribute .