src/BelongsTo.php
public function formatAssociatableResource(NovaRequest $request, $resource)
    {
        $relation = explode(".", $this->groupedBy);

        $groupedBy = count($relation) == 2
                   ? $resource->{$relation[0]}->{$relation[1]}
                   : $resource->{$this->groupedBy};

        return array_filter([
            'groupedBy' => $groupedBy,
            'avatar' => $resource->resolveAvatarUrl($request),
            'display' => $this->formatDisplayValue($resource),
            'value' => $resource->getKey(),
        ]);
    }
public function formatAssociatableResource(NovaRequest $request, $resource)
    {
        $relation = explode(".", $this->groupedBy);

        $groupedBy = count($relation) == 2
                   ? $resource->{$relation[0]}->{$relation[1]}
                   : $resource->{$this->groupedBy};

        return array_filter([
            'groupedBy' => $groupedBy,
            'avatar' => $resource->resolveAvatarUrl($request),
            'display' => $this->formatDisplayValue($resource),
            'value' => $resource->getKey(),
        ]);
    }
public function formatAssociatableResource ( NovaRequest $ request , $ resource ) { $ relation = explode ( "." , $ this -> groupedBy ) ; $ groupedBy = count ( $ relation ) == 2 ? $ resource -> { $ relation [ 0 ] } -> { $ relation [ 1 ] } : $ resource -> { $ this -> groupedBy } ; return array_filter ( [ 'groupedBy' => $ groupedBy , 'avatar' => $ resource -> resolveAvatarUrl ( $ request ) , 'display' => $ this -> formatDisplayValue ( $ resource ) , 'value' => $ resource -> getKey ( ) , ] ) ; }
Format the given associatable resource.

@param  \Laravel\Nova\Http\Requests\NovaRequest  $request
@param  mixed  $resource
@return array
Format the given associatable resource .