PHP code example of sertxudeveloper / laravel-sitemap

1. Go to this page and download the library: Download sertxudeveloper/laravel-sitemap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sertxudeveloper / laravel-sitemap example snippets


$sitemap = Sitemap::create();

$sitemap->add(Url::create(route("main.index")));

$sitemap->writeToFile(public_path('sitemap.xml'))