Can not clone row, template variable not found or variable contains markup

63 views Asked by At

I'm using phpword and laravel 10. I want to display the peserta_kegiatan (activity participant) data on a table in MS Word. I tried this way, but the error appears: "Can not clone row, template variable not found or variable contains markup". What's wrong? This is the code I have tried:

public function pesertaKegiatans()
{
    return $this->hasMany(PesertaKegiatan::class, 'proposal_pkm_id');
}

$pesertaKegiatans = $proposal->pesertaKegiatans;
$pesertas = [];
foreach ($pesertaKegiatans as $peserta) {
        $pesertas[] = [
            "nama_mahasiswa" => $peserta->nama_peserta,
            "nim_mahasiswa" => $peserta->nim,
            "prodi_mahasiswa" => $peserta->program_studi,
            "peminatan_mahasiswa" => $peserta->peminatan
        ];
    }
$template->cloneRowAndSetValues('nama_mahasiswa', $pesertas);

This is my MS Word template: enter image description here

0

There are 0 answers