src/MediaRepository.php
public function getCollection(HasMedia $model, string $collectionName, $filter = []): Collection
    {
        return $this->applyFilterToMediaCollection($model->loadMedia($collectionName), $filter);
    }
public function getCollection(HasMedia $model, string $collectionName, $filter = []): Collection
    {
        return $this->applyFilterToMediaCollection($model->loadMedia($collectionName), $filter);
    }
public function getCollection ( HasMedia $ model , string $ collectionName , $ filter = [ ] ) : Collection { return $ this -> applyFilterToMediaCollection ( $ model -> loadMedia ( $ collectionName ) , $ filter ) ; }
Get all media in the collection.

@param \Spatie\MediaLibrary\HasMedia\HasMedia $model
@param string $collectionName
@param array|callable $filter

@return \Illuminate\Support\Collection
Get all media in the collection .