wip
This commit is contained in:
1 parent
74a8556ba8
commit
75a7880d67
1 file changed
+4
-4
@@ -31,7 +31,7 @@ public function downloadCardRequisite(Card $record, Component $livewire)
|
||||
|
||||
$path = $this->generateFile($record, $response);
|
||||
|
||||
return response()->download(public_path($path));
|
||||
return response()->download($path);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,14 +85,14 @@ public function generateFile(Card $model, object $response)
|
||||
]);
|
||||
|
||||
$unique_folder_name = Str::snake(str_replace(':', '-', $model->created_at->toDateTimeString()));
|
||||
$dir = public_path("files/card-requisite/{$unique_folder_name}");
|
||||
$dir = storage_path("card-requisite/{$unique_folder_name}");
|
||||
|
||||
File::makeDirectory($dir, 0777, true, true);
|
||||
|
||||
$filePath = $dir."/{$model->id}.docx";
|
||||
$filePath = $dir."/kart-rekwizit-{$model->id}.docx";
|
||||
|
||||
$templateProcessor->saveAs($filePath);
|
||||
|
||||
return "files/card-requisite/{$unique_folder_name}/kart-rekwizit-{$model->id}.docx";
|
||||
return $filePath;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user