open($target); // Once we have the Zip archive, we can open it and extract it // into the working directory. By convention, we expect the // archive to contain one root directory, and all of the // bundle contents should be stored in that directory. $zip->extractTo($work); $latest = File::latest($work)->getRealPath(); @chmod($latest, 0777); // Once we have the latest modified directory, we should be // able to move its contents over into the bundles folder // so the bundle will be usable by the develoepr. File::mvdir($latest, $path); @unlink($target); } }