v1.5.24bb Added comments
This commit is contained in:
@@ -214,19 +214,25 @@ class MenuPlanController extends Controller
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function genPDF($Id){
|
||||
//get the menuplan with the matching id
|
||||
$menuPlan = MenuPlan::query()->where("id", "=", $Id)->first();
|
||||
|
||||
//Sub string cap
|
||||
$var = 250;
|
||||
|
||||
//Substring the data
|
||||
$menuPlan->monday = substr($menuPlan->monday, 0, $var);
|
||||
$menuPlan->tuesday = substr($menuPlan->tuesday, 0, $var);
|
||||
$menuPlan->wednesday = substr($menuPlan->wednesday, 0, $var);
|
||||
$menuPlan->thursday = substr($menuPlan->thursday, 0, $var);
|
||||
|
||||
//Pass the substring data to the genPDF pages
|
||||
$pdf = PDF::loadView('pdf.menuplan', ["menuPlan" => $menuPlan]);
|
||||
|
||||
//PDF config
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
|
||||
//return the pdf
|
||||
return $pdf->stream("menuplan_uge_".$menuPlan->week.".pdf");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user