'Calm', 'user_id' => null, 'company_id' => null, 'is_custom' => false, 'design' => '', 'is_active' => true]; $design = Design::create($design); $template = new PdfMakerDesign(strtolower($design->name)); $template->document(); $design_object = new \stdClass; $design_object->includes = $template->getSectionHTML('style'); $design_object->header = $template->getSectionHTML('header'); $design_object->body = $template->getSectionHTML('body'); $design_object->product = ''; $design_object->task = ''; $design_object->footer = $template->getSectionHTML('footer'); $design->design = $design_object; $design->save(); } /** * Reverse the migrations. * * @return void */ public function down() { // } };