document = $document; $this->hideShow = $hideShow; // Load relations if not loaded to prevent lazy loading $relations = ['contact', 'last_history', 'items', 'totals']; foreach ($relations as $relation) { if (! $document->relationLoaded($relation)) { $document->load($relation); } } $this->showRoute = $this->getShowRoute($document->contact->type, $showRoute); $this->showDocumentRoute = $this->getShowRoute($document->type, $showDocumentRoute); $this->placement = (! empty($placement)) ? $placement : 'left'; $this->id = (! empty($id)) ? $id : 'tooltip-information-' . $document->id; } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|string */ public function render() { return view('components.documents.index.information'); } }