PHPackages                             huysynf/laravel-indexnow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. huysynf/laravel-indexnow

ActiveLibrary

huysynf/laravel-indexnow
========================

Laravel package for IndexNow API integration - Automatically submit URLs to search engines

v1.0.15(3mo ago)01MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

Since Jan 17Pushed 3mo agoCompare

[ Source](https://github.com/huysynf/laravel-indexnow)[ Packagist](https://packagist.org/packages/huysynf/laravel-indexnow)[ RSS](/packages/huysynf-laravel-indexnow/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (17)Used By (0)

Laravel IndexNow
================

[](#laravel-indexnow)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2e7513ea4f2eb45a1dcef48f0f5e55a941475b64e2fda73fbcd19147f30c7d5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68757973796e662f6c61726176656c2d696e6465786e6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/huysynf/laravel-indexnow)[![Total Downloads](https://camo.githubusercontent.com/751f04d31a3af69c73d3aa4db7dc923f31f296879d03fd05b47400e6141c9b7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68757973796e662f6c61726176656c2d696e6465786e6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/huysynf/laravel-indexnow)

Laravel package for IndexNow API integration. Automatically submit URLs to search engines (Bing, Google, Yandex, etc.) when content is created, updated, or deleted.

Features
--------

[](#features)

✅ **Automatic URL Submission** - Submit URLs automatically when models change
✅ **Queue Support** - Async submission with retry logic
✅ **Rate Limiting** - Prevent duplicate submissions
✅ **Event-Driven** - Use Laravel events for flexible integration
✅ **REST API** - Full API for manual submissions
✅ **Artisan Commands** - CLI tools for management
✅ **Statistics** - Track submission success/failure
✅ **Laravel 8-12 Support** - Compatible with Laravel 8, 9, 10, 11, and 12

Installation
------------

[](#installation)

Install via Composer:

```
composer require huysynf/laravel-indexnow
```

Publish the config file (migrations are loaded automatically):

```
php artisan vendor:publish --tag=indexnow-config
```

Run migrations:

```
php artisan migrate
```

Generate an API key:

```
php artisan indexnow:generate-key
```

Configuration
-------------

[](#configuration)

Edit `config/indexnow.php`:

```
return [
    // Your IndexNow API key
    'api_key' => env('INDEXNOW_API_KEY', ''),

    // Enable/disable auto submission
    'enabled' => env('INDEXNOW_ENABLED', true),

    // Queue configuration
    'queue' => [
        'enabled' => true,
        'connection' => null,
        'queue' => 'default',
    ],

    // Models to watch for changes
    'models' => [
        // Add your models here
        // \App\Models\Post::class,
    ],
];
```

Usage
-----

[](#usage)

### 1. Automatic Submission (Recommended)

[](#1-automatic-submission-recommended)

Add models to watch in `config/indexnow.php`:

```
'models' => [
    \App\Models\Post::class,
    \App\Models\Page::class,
],
```

Implement `getIndexNowUrl()` method in your models:

```
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    /**
     * Get the public URL for IndexNow submission.
     *
     * @return string|null
     */
    public function getIndexNowUrl()
    {
        return route('posts.show', $this->slug);
    }
}
```

That's it! URLs will be submitted automatically when posts are created, updated, or deleted.

### 2. Manual Submission via Facade

[](#2-manual-submission-via-facade)

```
use Huysynf\LaravelIndexNow\Facades\IndexNow;

// Submit a single URL
IndexNow::submitUrl('https://example.com/page', 'add');

// Submit multiple URLs
IndexNow::submitBatch([
    'https://example.com/page1',
    'https://example.com/page2',
]);

// Get statistics
$stats = IndexNow::getStats();

// Resubmit failed URLs
IndexNow::resubmitFailed(10);
```

### 3. Manual Submission via Events

[](#3-manual-submission-via-events)

```
use Huysynf\LaravelIndexNow\Events\ContentPublished;

// Fire event to submit URL
event(new ContentPublished('https://example.com/page'));
```

### 4. Artisan Commands

[](#4-artisan-commands)

```
# Generate API key
php artisan indexnow:generate-key

# Submit URL manually
php artisan indexnow:submit https://example.com/page --type=add

# Migrate existing URLs from configured models
# Note: Skips URLs that have ANY successful submission in history
php artisan indexnow:migrate-urls

# Force submission of all URLs (ignore history)
php artisan indexnow:migrate-urls --force

# Migrate specific model only
php artisan indexnow:migrate-urls --model="App\Models\Post"

# Limit number of URLs to migrate
php artisan indexnow:migrate-urls --limit=100

# Process in custom chunk size
php artisan indexnow:migrate-urls --chunk=50
```

---

Admin Dashboard
---------------

[](#admin-dashboard)

Optional admin dashboard UI for managing IndexNow submissions.

**Access:** `/admin/indexnow` (requires authentication by default)

**Configuration** (`config/indexnow.php`):

```
'dashboard' => [
    'enabled' => true,
    'route' => 'admin/indexnow',
    'middleware' => ['web', 'auth'],
    'layout' => 'layouts.app',
],
```

**Features:**

- Statistics (weekly, success rate, total passed)
- Manual URL submission
- Resubmit failed URLs
- Recent submissions table

---

### 5. REST API

[](#5-rest-api)

**Submit URL:**

```
POST /api/indexnow/submit
Content-Type: application/json

{
  "url": "https://example.com/page",
  "type": "add"
}
```

**Get Statistics:**

```
GET /api/indexnow/stats
```

**Get Submissions:**

```
GET /api/indexnow/submissions?status=passed&per_page=20
```

**Resubmit Failed:**

```
POST /api/indexnow/resubmit
Content-Type: application/json

{
  "limit": 10
}
```

API Middleware Configuration
----------------------------

[](#api-middleware-configuration)

Customize middleware for API routes in `config/indexnow.php`:

```
'middleware' => [
    'api',
    'auth:sanctum',     // Require authentication
    'throttle:60,1',    // Rate limiting: 60 requests per minute
],
```

**Common Use Cases:**

**Require Authentication:**

```
'middleware' => ['api', 'auth:sanctum'],
```

**Add Rate Limiting:**

```
'middleware' => ['api', 'throttle:60,1'],
```

**Custom Middleware:**

```
'middleware' => ['api', 'your-custom-middleware'],
```

API Key Verification
--------------------

[](#api-key-verification)

IndexNow requires a verification file at `https://yourdomain.com/{api_key}.txt`.

This package automatically serves this file. After generating your API key, verify it works:

```
https://yourdomain.com/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6.txt

```

Queue Configuration
-------------------

[](#queue-configuration)

For better performance, enable queue processing:

1. Set up a queue driver (database, redis, etc.)
2. Run queue worker:

```
php artisan queue:work
```

Rate Limiting
-------------

[](#rate-limiting)

The package prevents submitting the same URL multiple times within a short period (default: 60 seconds).

Configure in `config/indexnow.php`:

```
'rate_limit' => [
    'enabled' => true,
    'cooldown' => 60, // seconds
],
```

Statistics &amp; Monitoring
---------------------------

[](#statistics--monitoring)

View submission statistics:

```
use Huysynf\LaravelIndexNow\Models\IndexNowSubmission;

// Get all stats
$stats = IndexNowSubmission::getStats();

// Get recent submissions
$recent = IndexNowSubmission::recent(7)->get();

// Get failed submissions
$failed = IndexNowSubmission::failed()->get();
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Huysynf](https://github.com/huysynf)
- Inspired by the WordPress IndexNow plugin by Microsoft Bing

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Support
-------

[](#support)

- 📧 Email:
- 🐛 Issues: [GitHub Issues](https://github.com/huysynf/laravel-indexnow/issues)
- 📖 Documentation: [Full Documentation](https://github.com/huysynf/laravel-indexnow)

Resources
---------

[](#resources)

- [IndexNow Official Documentation](https://www.indexnow.org/)
- [Bing Webmaster Tools](https://www.bing.com/webmasters)
- [Laravel Package Development](https://laravel.com/docs/packages)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance79

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

16

Last Release

112d ago

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.0|^8.1|^8.2

v1.0.14PHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1b9fbf2bae46fdaa0686417c7e9f3e217c98378d70bd9cf9e99177c0a05ae9b?d=identicon)[huysynf](/maintainers/huysynf)

---

Top Contributors

[![huyhqdeha](https://avatars.githubusercontent.com/u/125626140?v=4)](https://github.com/huyhqdeha "huyhqdeha (18 commits)")

---

Tags

laravelgoogleseosearch enginebingindexnowurl-submission

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/huysynf-laravel-indexnow/health.svg)

```
[![Health](https://phpackages.com/badges/huysynf-laravel-indexnow/health.svg)](https://phpackages.com/packages/huysynf-laravel-indexnow)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[laragear/preload

Effortlessly make a Preload script for your Laravel application.

119363.5k](/packages/laragear-preload)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
