path()); } public function path() { $type = Utils::pluralizeEntityType($this->entity->getEntityType()); $id = $this->entity->public_id; return sprintf('/%s/%s', $type, $id); } public function editUrl() { return $this->url() . '/edit'; } public function statusLabel() { $class = $text = ''; if ($this->entity->is_deleted) { $class = 'danger'; $label = trans('texts.deleted'); } elseif ($this->entity->trashed()) { $class = 'warning'; $label = trans('texts.archived'); } else { $class = $this->entity->statusClass(); $label = $this->entity->statusLabel(); } return "{$label}"; } /** * @return mixed */ public function link() { $name = $this->entity->getDisplayName(); $link = $this->url(); return link_to($link, $name)->toHtml(); } public function titledName() { $entity = $this->entity; $entityType = $entity->getEntityType(); return sprintf('%s: %s', trans('texts.' . $entityType), $entity->getDisplayName()); } }