public function writeCache($path, $packages)
    {
        $data = array();

        foreach ($packages->all() as $key => $package) {
            $properties = ($package instanceof Collection) ? $package->all() : $package;

            // Normalize to *nix paths.
            $properties['path'] = str_replace('\\', '/', $properties['path']);

            //
            ksort($properties);

            $data[] = $properties;
        }

        //
        $data = var_export($data, true);

        $content = <<<PHP
<?php

return $data;

PHP;

        $this->files->put($path, $content);
    }