v0.9.5 - Removed images support from pdf menuplan, added dynamic name support for the pdf document
This commit is contained in:
parent
4a46817265
commit
9c70a0c4b4
|
@ -182,13 +182,15 @@ class MenuPlanController extends Controller
|
|||
* @return RedirectResponse
|
||||
*/
|
||||
public function genPDF($Id){
|
||||
$images = App\Resource::query()->where("id", '=', $Id)->first();
|
||||
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
|
||||
//$images = App\Resource::query()->where("id", '=', $menuPlan->resource_id)->first();
|
||||
//$imagesSize = getimagesize($images->filename);
|
||||
$pdf = \Illuminate\Support\Facades\App::make('dompdf.wrapper');
|
||||
$data = '<div style="text-align: center">'. '<h1 style="font-size: 36px">Uge '. $menuPlan->week. '</h1>' .$menuPlan->menu. '<img class="w-100" src="' . asset($images->filename). '">'. '</div>';
|
||||
$data = '<div style="text-align: center">'. '<h1 style="font-size: 36px">Uge '. $menuPlan->week. '</h1>' .$menuPlan->menu. /*$imagesSize .'<img class="w-100" src="' . asset($images->filename). '">'. */'</div>';
|
||||
|
||||
$pdf->loadHTML($data);
|
||||
return $pdf->stream();
|
||||
|
||||
return $pdf->stream("menuplan_uge_".$menuPlan->week.".pdf");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue