code: public function isRelation($key)
      {
          if(!method_exists($this->model, $key)) {
              return false;
          }
          $relation = $this->model->{$key}();
          return ($relation instanceof Relation);
      }
docs: Check if a key is a relation
  
  @param string $key
  @return bool