PHP code example of ymigval / laravel-indexnow

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

    

ymigval / laravel-indexnow example snippets


use Ymigval\LaravelIndexnow\Facade\IndexNow;

IndexNow::submit('https://www.example.com/my-page');

use Ymigval\LaravelIndexnow\Facade\IndexNow;

// Using array
IndexNow::submit([
    'https://www.example.com/page-1',
    'https://www.example.com/page-2',
    'https://www.example.com/page-3',
]);

// Or using method chaining
IndexNow::setUrl('https://www.example.com/page-1')
        ->setUrl('https://www.example.com/page-2')
        ->setUrl('https://www.example.com/page-3')
        ->submit();
shell script
php artisan vendor:publish --tag="indexnow"
shell script
# View your IndexNow API key
php artisan indexnow:apikey

# If the route doesn't work, clear and cache routes
php artisan route:clear
php artisan route:cache

# Check IndexNow package status and configuration
php artisan indexnow:status
shell script
php artisan indexnow:logs