1

This is my first time of asking any question. I've generate daily sitemap using "spatie/laravel-sitemap" package. I want to add url of the new post when admin create a new post into sitemap.

I want to import uri into already created sitemap-file.

reference of the creating sitemap : https://github.com/spatie/laravel-sitemap

I've tried this :

Sitemap::create() 
    ->add(Url::create('/home')
       ->setLastModificationDate(Carbon::yesterday())
       ->setChangeFrequency(Url::CHANGE_FREQUENCY_YEARLY)
       ->setPriority(0.1))
    ->writeToFile('sitemap.xml');

but it was create a new sitemap file

0 Answers0