lundi 26 juin 2017

Generating an XML Sitemap in Laravel 5

I have a laravel application that is still in the development stages. I am currently trying to generate a sitemap for the application using Spatie\Sitemap\SitemapGenerator but my code isn't working. This is my sitemap code in a file called GenerateSiteMap.php:

<?php

use Spatie\Sitemap\SitemapGenerator;

class GenerateSiteMap
{
    public function generateSite()
    {
        $generator = SitemapGenerator::create('http://127.0.0.1:8000/')->writeToFile('sitemap.xml');
        return $generator;
    }
}

It doesn't give me any errors when I run it, it just doesn't do anything. Any idea how I can fix it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire