get() as $design) { $class = 'App\Designs\\'.$design->name; $invoice_design = new $class(); $design_object = new \stdClass; $design_object->includes = $invoice_design->includes() ?: ''; $design_object->header = $invoice_design->header() ?: ''; $design_object->body = $invoice_design->body() ?: ''; $design_object->product = $invoice_design->product() ?: ''; $design_object->task = $invoice_design->task() ?: ''; $design_object->footer = $invoice_design->footer() ?: ''; $design->design = $design_object; $design->save(); } } }