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);
    }
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);
    }
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 ) ; }
Write the service cache file to disk.

@param  string $path
@param  array  $packages
@return void
Write the service cache file to disk .