0

here I'm using sitemap

    $sitemap = Sitemap::create()->add(Url::create('/content'));
    
    $sitemap->writeToFile(public_path($this->path));

and this is sitemap.xml

<url>
    <loc>http://api-core.test/content</loc>
    <lastmod>2020-09-09T11:30:51+04:30</lastmod>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
</url>

is there any way to change api-core.test without changing env

apokryfos
  • 38,771
  • 9
  • 70
  • 114
arefeh
  • 33
  • 7

1 Answers1

0

I found a way to change baseurl if string in Url::create('http://example.com/content') contain http create function does not paste the url at the beginning of the string

sitemap will change to

<url>
     <loc>http://example.com/content</loc>
     <lastmod>2020-09-09T11:30:51+04:30</lastmod>
     <changefreq>daily</changefreq>
     <priority>0.8</priority>
</url>

even if APP_URL is somthing else

arefeh
  • 33
  • 7