src/MediableCollection.php
public function loadMediaMatchAll($tags = [])
    {
        $tags = (array) $tags;
        $closure = function (MorphToMany $q) use ($tags) {
            $this->addMatchAllToEagerLoadQuery($q, $tags);
        };
        $closure = Closure::bind($closure, $this->first(), $this->first());

        return $this->load(['media' => $closure]);
    }
public function loadMediaMatchAll($tags = [])
    {
        $tags = (array) $tags;
        $closure = function (MorphToMany $q) use ($tags) {
            $this->addMatchAllToEagerLoadQuery($q, $tags);
        };
        $closure = Closure::bind($closure, $this->first(), $this->first());

        return $this->load(['media' => $closure]);
    }
public function loadMediaMatchAll ( $ tags = [ ] ) { $ tags = ( array ) $ tags ; $ closure = function ( MorphToMany $ q ) use ( $ tags ) { $ this -> addMatchAllToEagerLoadQuery ( $ q , $ tags ) ; } ; $ closure = Closure :: bind ( $ closure , $ this -> first ( ) , $ this -> first ( ) ) ; return $ this -> load ( [ 'media' => $ closure ] ) ; }
Lazy eager load media attached to items in the collection bound all of the provided tags simultaneously.
@param  string|string[]  $tags
If one or more tags are specified, only media attached to those tags will be loaded.
@return $this
Lazy eager load media attached to items in the collection bound all of the provided tags simultaneously .