I want convert html file to pdf with laravel-snappy but i got message
Parse error: syntax error, unexpected '$pdf' (T_VARIABLE)
This is my code
public function pdf($id){
$data['data'] = DB::table('data_peminjaman')
->join('inventaris', 'data_peminjaman.id_invetaris', '=', 'inventaris.id')
->where('data_peminjaman.iid', $id)
->get();
$nama = DB::table('data_peminjaman')
->select('inventaris.name')
->join('inventaris', 'data_peminjaman.id_invetaris', '=', 'inventaris.id')
->where('data_peminjaman.iid', $id)
->get();
$tgl = DB::table('data_peminjaman')
->select('tgl_pinjam')
->where('iid', $id)
->get();
$namafile = $nama+'-'+$tgl+'.pdf'
$pdf = PDF::loadView('pdf.surat', $data);
return $pdf->download($namafile);
}
+'.pdf'. And as an aside, PHP uses.to concatenate strings, not+. - user149341