protected function removeDuplicates()
    {
        foreach ($this->assets as $type => &$collection) {

            $pathCache = [];
            foreach ($collection as $key => $asset) {

                if (!$path = array_get($asset, 'path')) {
                    continue;
                }

                if (isset($pathCache[$path])) {
                    array_forget($collection, $key);
                    continue;
                }

                $pathCache[$path] = true;
            }

        }
    }
protected function removeDuplicates()
    {
        foreach ($this->assets as $type => &$collection) {

            $pathCache = [];
            foreach ($collection as $key => $asset) {

                if (!$path = array_get($asset, 'path')) {
                    continue;
                }

                if (isset($pathCache[$path])) {
                    array_forget($collection, $key);
                    continue;
                }

                $pathCache[$path] = true;
            }

        }
    }
protected function removeDuplicates ( ) { foreach ( $ this -> assets as $ type => & $ collection ) { $ pathCache = [ ] ; foreach ( $ collection as $ key => $ asset ) { if ( ! $ path = array_get ( $ asset , 'path' ) ) { continue ; } if ( isset ( $ pathCache [ $ path ] ) ) { array_forget ( $ collection , $ key ) ; continue ; } $ pathCache [ $ path ] = true ; } } }
Removes duplicate assets from the entire collection.
@return void
Removes duplicate assets from the entire collection .