/** * @param array $options * * @return string */ protected function getLabel(array $options) { $label = parent::getLabel($options); if (!$label and isset($options['entity'])) { $label = $this->env->entity($options['entity'])->getPluralTitle(); } return $label; }
/** * Resolve an entity. * * @param string $id * @param string $action * * @return \Kalnoy\Cruddy\Entity */ protected function resolve($id, $action) { $entity = $this->environment->entity($id); if (!$entity->isPermitted($action)) { $message = trans("cruddy::app.forbidden.{$action}", ['entity' => $id]); throw new AccessDeniedException($message); } return $entity; }