src/Eloquent/Concerns/IncludesModels.php
protected function convertIncludePath($path)
    {
        if (array_key_exists($path, $this->includePaths)) {
            return $this->includePaths[$path] ?: null;
        }

        return collect(explode('.', $path))->map(function ($segment) {
            return $this->modelRelationForField($segment);
        })->implode('.');
    }
protected function convertIncludePath($path)
    {
        if (array_key_exists($path, $this->includePaths)) {
            return $this->includePaths[$path] ?: null;
        }

        return collect(explode('.', $path))->map(function ($segment) {
            return $this->modelRelationForField($segment);
        })->implode('.');
    }
protected function convertIncludePath ( $ path ) { if ( array_key_exists ( $ path , $ this -> includePaths ) ) { return $ this -> includePaths [ $ path ] ? : null ; } return collect ( explode ( '.' , $ path ) ) -> map ( function ( $ segment ) { return $ this -> modelRelationForField ( $ segment ) ; } ) -> implode ( '.' ) ; }
Convert a JSON API include path to a model relationship path.

@param $path
@return string|null
Convert a JSON API include path to a model relationship path .