protected function resolveRelations($dataTypeContent, DataType $dataType)
    {
        // In case of using server-side pagination, we need to work on the Collection (BROWSE)
        if ($dataTypeContent instanceof LengthAwarePaginator) {
            $dataTypeCollection = $dataTypeContent->getCollection();
        }
        // If it's a model just make the changes directly on it (READ / EDIT)
        elseif ($dataTypeContent instanceof Model) {
            return $dataTypeContent;
        }
        // Or we assume it's a Collection
        else {
            $dataTypeCollection = $dataTypeContent;
        }

        return $dataTypeContent instanceof LengthAwarePaginator ? $dataTypeContent->setCollection($dataTypeCollection) : $dataTypeCollection;
    }
protected function resolveRelations($dataTypeContent, DataType $dataType)
    {
        // In case of using server-side pagination, we need to work on the Collection (BROWSE)
        if ($dataTypeContent instanceof LengthAwarePaginator) {
            $dataTypeCollection = $dataTypeContent->getCollection();
        }
        // If it's a model just make the changes directly on it (READ / EDIT)
        elseif ($dataTypeContent instanceof Model) {
            return $dataTypeContent;
        }
        // Or we assume it's a Collection
        else {
            $dataTypeCollection = $dataTypeContent;
        }

        return $dataTypeContent instanceof LengthAwarePaginator ? $dataTypeContent->setCollection($dataTypeCollection) : $dataTypeCollection;
    }
protected function resolveRelations ( $ dataTypeContent , DataType $ dataType ) { // In case of using server-side pagination, we need to work on the Collection (BROWSE) if ( $ dataTypeContent instanceof LengthAwarePaginator ) { $ dataTypeCollection = $ dataTypeContent -> getCollection ( ) ; } // If it's a model just make the changes directly on it (READ / EDIT) elseif ( $ dataTypeContent instanceof Model ) { return $ dataTypeContent ; } // Or we assume it's a Collection else { $ dataTypeCollection = $ dataTypeContent ; } return $ dataTypeContent instanceof LengthAwarePaginator ? $ dataTypeContent -> setCollection ( $ dataTypeCollection ) : $ dataTypeCollection ; }
Replace relationships' keys for labels and create READ links if a slug is provided.

@param  $dataTypeContent     Can be either an eloquent Model, Collection or LengthAwarePaginator instance.
@param DataType $dataType

@return $dataTypeContent
Replace relationships keys for labels and create READ links if a slug is provided .