I want to try to make a report in laravel 4.2 by using HTML to PDF. I followed the instructions from here. but displays an error message like this:
syntax error, unexpected 'foreach' (T_FOREACH)
here's my code :
public function download($code){
$buckets = DB::table('buckets')->where('code',$code)->get();
$html = "<p>Code : ".$code."</p>
<p>Name : Febry Fairuz</p>".
foreach ($buckets as $bd) {
"<p>".$bd->id_rent."</p>".
}
"<p>".$bd->created_at."</p>";
return PDF::load($html, 'A4', 'portrait')->download('my_pdf');
}