public function zipTranslations($groups)
{
$zip_name = tempnam("Translations_" . time(), "zip");
// Zip name
$this->zipExporting = new ZipArchive();
$this->zipExporting->open($zip_name, ZipArchive::OVERWRITE);
if (!is_array($groups)) {
if ($groups === '*') {
$groups = $this->translation->whereNotNull('value')->select(DB::raw('DISTINCT `group`'))->get('group');
foreach ($groups as $group) {
// Stuff with content
$this->exportTranslations($group->group, 0);
}
} else {
// Stuff with content
$this->exportTranslations($groups, 0);
}
} else {
foreach ($groups as $group) {
// Stuff with content
$this->exportTranslations($group, 0);
}
}
$this->zipExporting->close();
$this->zipExporting = null;
return $zip_name;
}