PHP code example of rapidez / sitemap

1. Go to this page and download the library: Download rapidez/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/ */

    

rapidez / sitemap example snippets


Schedule::command('rapidez:sitemap:generate')->twiceDaily(0, 12);

Eventy::addAction('rapidez.sitemap.generate', fn() => DoMagicHere(), 20, 1);

use TorMorten\Eventy\Facades\Eventy;

Eventy::addFilter('rapidez.sitemap.{storeId}', function ($sitemaps) {
    // Add your custom sitemap URL here
    $sitemaps[] = [
        'url' => 'your-custom-sitemap.xml',
        'lastmod' => now()->toDateString(),
    ];
    
    return $sitemaps;
}, 20, 1);
bash
php artisan vendor:publish --tag=config --provider="Rapidez\Sitemap\SitemapServiceProvider"

php artisan vendor:publish --tag=rapidez-sitemap-views
bash
php artisan rapidez:sitemap:generate