public function render()
    {
        $relation = $this->model->{$this->name}();

        $renderable = $this->getNullRenderable();

        if ($relation    instanceof HasOne
            || $relation instanceof BelongsTo
            || $relation instanceof MorphOne
        ) {
            $model = $this->model->{$this->name};

            if (!$model instanceof Model) {
                $model = $relation->getRelated();
            }

            $renderable = new Show($model, $this->builder);

            $renderable->panel()->title($this->title);
        }

        if ($relation    instanceof HasMany
            || $relation instanceof MorphMany
            || $relation instanceof BelongsToMany
            || $relation instanceof HasManyThrough
        ) {
            $renderable = new Grid($relation->getRelated(), $this->builder);

            $renderable->setName($this->name)
                ->setTitle($this->title)
                ->setRelation($relation);
        }

        return $renderable->render();
    }
public function render()
    {
        $relation = $this->model->{$this->name}();

        $renderable = $this->getNullRenderable();

        if ($relation    instanceof HasOne
            || $relation instanceof BelongsTo
            || $relation instanceof MorphOne
        ) {
            $model = $this->model->{$this->name};

            if (!$model instanceof Model) {
                $model = $relation->getRelated();
            }

            $renderable = new Show($model, $this->builder);

            $renderable->panel()->title($this->title);
        }

        if ($relation    instanceof HasMany
            || $relation instanceof MorphMany
            || $relation instanceof BelongsToMany
            || $relation instanceof HasManyThrough
        ) {
            $renderable = new Grid($relation->getRelated(), $this->builder);

            $renderable->setName($this->name)
                ->setTitle($this->title)
                ->setRelation($relation);
        }

        return $renderable->render();
    }
public function render ( ) { $ relation = $ this -> model -> { $ this -> name } ( ) ; $ renderable = $ this -> getNullRenderable ( ) ; if ( $ relation instanceof HasOne || $ relation instanceof BelongsTo || $ relation instanceof MorphOne ) { $ model = $ this -> model -> { $ this -> name } ; if ( ! $ model instanceof Model ) { $ model = $ relation -> getRelated ( ) ; } $ renderable = new Show ( $ model , $ this -> builder ) ; $ renderable -> panel ( ) -> title ( $ this -> title ) ; } if ( $ relation instanceof HasMany || $ relation instanceof MorphMany || $ relation instanceof BelongsToMany || $ relation instanceof HasManyThrough ) { $ renderable = new Grid ( $ relation -> getRelated ( ) , $ this -> builder ) ; $ renderable -> setName ( $ this -> name ) -> setTitle ( $ this -> title ) -> setRelation ( $ relation ) ; } return $ renderable -> render ( ) ; }
Render this relation panel.

@return string
Render this relation panel .