backgroundColor = ! empty($backgroundColor) ? $backgroundColor : 'bg-lilac-900'; $this->textColor = ! empty($textColor) ? $textColor : 'text-purple'; $this->status = $status; $this->textStatus = $this->getTextStatus($textStatus); } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|string */ public function render() { return view('components.index.status'); } protected function getTextStatus($textStatus) { if (! empty($textStatus)) { return $textStatus; } $textStatus = trans('documents.statuses.' . $this->status); return $textStatus; } }