diff --git a/app/Domain/ResumeGenerator.php b/app/Domain/ResumeGenerator.php index 25420af..5960828 100644 --- a/app/Domain/ResumeGenerator.php +++ b/app/Domain/ResumeGenerator.php @@ -14,10 +14,6 @@ class ResumeGenerator { public function generate(Resume $resume): string { - $uid = Str::uuid(); - - $path = storage_path("${uid}.docx"); - $processor = new TemplateProcessor($this->getTemplate()); $processor->setValue("id", $resume->id); @@ -28,9 +24,7 @@ class ResumeGenerator $this->fillEducation($processor, $resume); $this->fillProjects($processor, $resume); - $processor->saveAs($path); - - return $path; + return $processor->save(); } public function getTemplate(): string diff --git a/tests/Feature/ResumeTest.php b/tests/Feature/ResumeTest.php index c7d1c70..735d535 100644 --- a/tests/Feature/ResumeTest.php +++ b/tests/Feature/ResumeTest.php @@ -131,8 +131,6 @@ class ResumeTest extends FeatureTestCase $resume = Resume::factory()->create(); $admin = User::factory()->admin()->create(); - $this->withoutExceptionHandling(); - $this->actingAs($admin) ->get("/resumes/{$resume->id}") ->assertDownload("resume-{$resume->id}.docx");