/**
  * Handle the command.
  *
  * @param EntryFormBuilder $builder
  */
 public function handle(EntryFormBuilder $builder)
 {
     $type = $this->partial->getType();
     $builder->setModel($type->getEntryModelName());
     $builder->setEntry($this->partial->getEntryId());
     $this->builder->addForm('entry', $builder);
 }
 /**
  * Catch calls to fields on
  * the page's related entry.
  *
  * @param string $key
  * @return mixed
  */
 public function __get($key)
 {
     $entry = $this->object->getEntry();
     if ($entry->hasField($key)) {
         return (new Decorator())->decorate($entry)->{$key};
     }
     return parent::__get($key);
 }
 /**
  * Handle the command.
  *
  * @param PartialFormBuilder $builder
  */
 public function handle(PartialFormBuilder $builder)
 {
     $builder->setEntry($this->partial->getId());
     $this->builder->addForm('partial', $builder);
 }
 /**
  * Return the view link.
  *
  * @return string
  */
 public function viewLink()
 {
     return app('html')->link('admin/partials/view/' . $this->object->getId(), $this->object->getTitle(), ['target' => '_blank']);
 }
 /**
  * Delete a partial.
  *
  * @param PartialInterface|EloquentModel $partial
  * @return bool
  */
 public function delete(PartialInterface $partial)
 {
     return $partial->delete();
 }