getRealPath(); $errors = (new ZipExportValidator($zipPath))->validate(); if ($errors) { throw new ZipValidationException($errors); } $zipEntityInfo = (new ZipExportReader($zipPath))->getEntityInfo(); $import = new Import(); $import->name = $zipEntityInfo['name']; $import->book_count = $zipEntityInfo['book_count']; $import->chapter_count = $zipEntityInfo['chapter_count']; $import->page_count = $zipEntityInfo['page_count']; $import->created_by = user()->id; $import->size = filesize($zipPath); $path = $this->storage->uploadFile( $file, 'uploads/files/imports/', '', 'zip' ); $import->path = $path; $import->save(); return $import; } }