service = $service; } public function build() :self { /*If the design is custom*/ if ($this->service->config->design->is_custom) { $this->template = $this->composeFromPartials(json_decode(json_encode($this->service->config->design->design), true)); } else { $this->template = file_get_contents(config('ninja.designs.base_path') . strtolower($this->service->config->design->name) . '.html'); } return $this; } /** * If the user has implemented a custom design, then we need to rebuild the design at this point */ private function composeFromPartials(array $partials) :string { $html = ''; $html .= $partials['includes']; $html .= $partials['header']; $html .= $partials['body']; $html .= $partials['footer']; return $html; } }