src/Transformer/Adapter/Fractal.php
protected function mergeEagerLoads($transformer, $requestedIncludes)
    {
        $includes = array_merge($requestedIncludes, $transformer->getDefaultIncludes());

        $eagerLoads = [];

        foreach ($includes as $key => $value) {
            $eagerLoads[] = is_string($key) ? $key : $value;
        }

        if (property_exists($transformer, 'lazyLoadedIncludes')) {
            $eagerLoads = array_diff($eagerLoads, $transformer->lazyLoadedIncludes);
        }

        return $eagerLoads;
    }
protected function mergeEagerLoads($transformer, $requestedIncludes)
    {
        $includes = array_merge($requestedIncludes, $transformer->getDefaultIncludes());

        $eagerLoads = [];

        foreach ($includes as $key => $value) {
            $eagerLoads[] = is_string($key) ? $key : $value;
        }

        if (property_exists($transformer, 'lazyLoadedIncludes')) {
            $eagerLoads = array_diff($eagerLoads, $transformer->lazyLoadedIncludes);
        }

        return $eagerLoads;
    }
protected function mergeEagerLoads ( $ transformer , $ requestedIncludes ) { $ includes = array_merge ( $ requestedIncludes , $ transformer -> getDefaultIncludes ( ) ) ; $ eagerLoads = [ ] ; foreach ( $ includes as $ key => $ value ) { $ eagerLoads [ ] = is_string ( $ key ) ? $ key : $ value ; } if ( property_exists ( $ transformer , 'lazyLoadedIncludes' ) ) { $ eagerLoads = array_diff ( $ eagerLoads , $ transformer -> lazyLoadedIncludes ) ; } return $ eagerLoads ; }
Get includes as their array keys for eager loading.

@param \League\Fractal\TransformerAbstract $transformer
@param string|array                        $requestedIncludes

@return array
Get includes as their array keys for eager loading .