original_string: protected function collectResource($resource)
      {
          if ($resource instanceof MissingValue) {
              return $resource;
          }
  
          $collects = $this->collects();
  
          $this->collection = $collects && ! $resource->first() instanceof $collects
              ? $resource->mapInto($collects)
              : $resource->toBase();
  
          return $resource instanceof AbstractPaginator
                      ? $resource->setCollection($this->collection)
                      : $this->collection;
      }
code: protected function collectResource($resource)
      {
          if ($resource instanceof MissingValue) {
              return $resource;
          }
  
          $collects = $this->collects();
  
          $this->collection = $collects && ! $resource->first() instanceof $collects
              ? $resource->mapInto($collects)
              : $resource->toBase();
  
          return $resource instanceof AbstractPaginator
                      ? $resource->setCollection($this->collection)
                      : $this->collection;
      }
code_tokens: protected function collectResource ( $ resource ) { if ( $ resource instanceof MissingValue ) { return $ resource ; } $ collects = $ this -> collects ( ) ; $ this -> collection = $ collects && ! $ resource -> first ( ) instanceof $ collects ? $ resource -> mapInto ( $ collects ) : $ resource -> toBase ( ) ; return $ resource instanceof AbstractPaginator ? $ resource -> setCollection ( $ this -> collection ) : $ this -> collection ; }
docstring: Map the given collection resource into its individual resources.
  
  @param  mixed  $resource
  @return mixed
docstring_tokens: Map the given collection resource into its individual resources .