PHP code example of elbgoods / laravel-sitemap

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

    

elbgoods / laravel-sitemap example snippets


[
    'loc' => 'https://example.com/terms', // (nal) last page modification
    'priority' => 0.9, // (optional) site priority
    'changefreq' => SitepageUrl::daily // (optional) page change frequency
]

public static function getSitemapQuery(): Builder

$schedule->command('sitemap:generate')
    ->daily()
    ->sendOutputTo($filePath);
bash
php artisan vendor:publish --provider="Elbgoods\LaravelSitemap\LaravelSitemapServiceProvider" --tag=config
bash
php artisan sitemap:generate > sitemap.xml