You can try to use beanstalkd or iron.io; if you setup the credentials for it you can do this:
Queue::push(function()
{
$pathToStore = public_path() . '/backups';
$pathToImages = public_path() . '/imgs'; // Your images folder
$zipFIle = "Backup-" . (new Carbon\Carbon())->format('Y-m-d') . ".zip"; // Backup-2015-05-9.zip
$zip = new ZipArchive;
if ($zip->open($pathToStore. '/' . $zipFile, ZipArchive::CREATE) === true)
{
foreach (glob($pathToImages . '/*') as $fileName)
{
$file = basename($fileName);
$zip->addFile($fileName, $file);
}
$zip->close();
}
});
If you still get a timeout, you can try this:
set_time_limit(0); // infinity
But that is not recommended