job = $job; $this->exportDisk = Storage::disk('export'); } /** * @return bool */ public function make() { $fields = array_keys(get_class_vars(Entry::class)); $types = Entry::getTypes(); $configuration = [ 'date-format' => 'Y-m-d', // unfortunately, this is hard-coded. 'has-headers' => true, 'map' => [], // we could build a map if necessary for easy re-import. 'roles' => [], 'mapped' => [], 'specifix' => [], ]; foreach ($fields as $field) { $configuration['roles'][] = $types[$field]; } $file = $this->job->key . '-configuration.json'; Log::debug('Created JSON config file.'); Log::debug('Will put "' . $file . '" in the ZIP file.'); $this->exportDisk->put($file, json_encode($configuration, JSON_PRETTY_PRINT)); return $file; } }