PHP code example of curlychoi / laravel-sitemap

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

    

curlychoi / laravel-sitemap example snippets

 bash
php artisan vendor:publish --provider="Curlychoi\LaravelSitemap\Providers\SitemapServiceProvider" --tag=migrations
php artisan migrate
 php
$url = request()->getSchemeAndHttpHost() . '/posts/1';
Sitemap::put($url);
 php
$url = request()->getSchemeAndHttpHost() . '/posts/1';
Sitemap::forget($url);