original_string: protected function resolveNestedRelations($data, $request)
      {
          foreach ($data as $key => $value) {
              if (is_array($value)) {
                  $data[$key] = $this->resolveNestedRelations($value, $request);
              }
              elseif ($value instanceof static) {
                  $data[$key] = $value->resolve($request);
              }
          }
  
          return $this->filter($data);
      }
code: protected function resolveNestedRelations($data, $request)
      {
          foreach ($data as $key => $value) {
              if (is_array($value)) {
                  $data[$key] = $this->resolveNestedRelations($value, $request);
              }
              elseif ($value instanceof static) {
                  $data[$key] = $value->resolve($request);
              }
          }
  
          return $this->filter($data);
      }
code_tokens: protected function resolveNestedRelations ( $ data , $ request ) { foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) ) { $ data [ $ key ] = $ this -> resolveNestedRelations ( $ value , $ request ) ; } elseif ( $ value instanceof static ) { $ data [ $ key ] = $ value -> resolve ( $ request ) ; } } return $ this -> filter ( $ data ) ; }
docstring: Resolve the nested resources to an array.
  
  @param  array                     $data
  @param  \Illuminate\Http\Request  $request
  
  @return array
docstring_tokens: Resolve the nested resources to an array .