Я пытаюсь изменить вывод моего формата даты в моем шаблоне PhpWord, но это не работает. В моем контроллере у меня есть:
public function edit(Attestationstagiaire $attestationstagiaire, $downloadName = null)
{
$id = $attestationstagiaire->id;
$desc1 = Attestationstagiaire::find($id);
$my_template = new \PhpOffice\PhpWord\TemplateProcessor(public_path('templates/stagiaire/attestation.docx'));
$my_template->setValue('id', $desc1->id);
$my_template->setValue('prenoms', $desc1->prenoms);
$my_template->setValue('nom', $desc1->nom);
$my_template->setValue('date_de_naissance', $desc1->date_de_naissance);
$my_template->setValue('lieu_de_naissance', $desc1->lieu_de_naissance);
try{
$my_template->saveAs(storage_path("Document.docx"));
}catch (Exception $e){
//handle exception
}
return response()->download(storage_path("Document.docx"));
}
В строке -> $ my_template-> setValue ('date_de_naissance', $ desc1-> date_de_naissance); Мой формат даты в выходном документе показывает 12-07-2020 , но я хочу иметь 12 июля 2020 . Как я могу сделать? Спасибо за помощь!