private function buildRelationshipAttributes($model)
    {
        $result = [];

        foreach ($model->getSearchRelationships() as $method) {
            if (!method_exists($model, $method)) {
                continue;
            }

            $relation = self::getRelation($model->$method());
            $this->relationships[$method] = $relation;

            self::buildCastedAttributes($relation['model'], $result, $method);
            self::buildSearchAttributes($relation['model'], $result, $method);
        }

        return $result;
    }