public function all($directory = '/')
    {
        $directories = $this->directories($directory)->transform(function ($item) {
            return $item + ['type' => self::MEDIA_TYPE_DIRECTORY];
        });

        $files = $this->files($directory)->transform(function (array $item) {
            return $item + ['type' => self::MEDIA_TYPE_FILE];
        });

        return array_merge($directories->toArray(), $files->toArray());
    }
public function all($directory = '/')
    {
        $directories = $this->directories($directory)->transform(function ($item) {
            return $item + ['type' => self::MEDIA_TYPE_DIRECTORY];
        });

        $files = $this->files($directory)->transform(function (array $item) {
            return $item + ['type' => self::MEDIA_TYPE_FILE];
        });

        return array_merge($directories->toArray(), $files->toArray());
    }
public function all ( $ directory = '/' ) { $ directories = $ this -> directories ( $ directory ) -> transform ( function ( $ item ) { return $ item + [ 'type' => self :: MEDIA_TYPE_DIRECTORY ] ; } ) ; $ files = $ this -> files ( $ directory ) -> transform ( function ( array $ item ) { return $ item + [ 'type' => self :: MEDIA_TYPE_FILE ] ; } ) ; return array_merge ( $ directories -> toArray ( ) , $ files -> toArray ( ) ) ; }
Get all the directories & files from a given location.

@param  string  $directory

@return array
Get all the directories & files from a given location .