Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }