Effect of density and nucleon-nucleon potential on the fusion cross section within the relativistic mean field formalism