PHPackages                             elfeffe/laravel-google-indexing - 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. [API Development](/categories/api)
4. /
5. elfeffe/laravel-google-indexing

ActiveLibrary[API Development](/categories/api)

elfeffe/laravel-google-indexing
===============================

Index Laravel website in Google via Indexing API

v1.0.0(1mo ago)39MITPHPPHP ^8.4

Since Mar 22Pushed 1mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

elfeffe/laravel-google-indexing
===============================

[](#elfeffelaravel-google-indexing)

Submit URLs to Google's Indexing API from Laravel and track successful submissions in `google_indexing_records`.

This package is useful for sites that are eligible for the Google Indexing API and want:

- direct URL update/delete requests
- helper methods for quota-aware indexing
- a reusable `GoogleIndexable` trait for models
- persistent records of successful submissions

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 12 or 13
- a Google service account configured for the Indexing API

Important note
--------------

[](#important-note)

Google only allows the Indexing API for specific content types, such as job posting and livestream pages. Check the official docs before using it broadly:

[Google Indexing API docs](https://developers.google.com/search/apis/indexing-api/v3/quickstart)

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

[](#installation)

```
composer require elfeffe/laravel-google-indexing:^1.0
```

Publish the config:

```
php artisan vendor:publish --tag=laravel-google-indexing-config
```

Publish the migration:

```
php artisan vendor:publish --tag=laravel-google-indexing-migrations
```

The package now reuses an existing published `create_google_indexing_records_table` migration if one is already present, so republishing does not create duplicate migration files.

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

[](#configuration)

By default the package expects the Google auth JSON at:

```
storage_path('google_auth_config.json')
```

You can override it in `config/laravel-google-indexing.php`:

```
return [
    'google' => [
        'auth_config' => storage_path('google_auth_config.json'),
        'scopes' => [
            'https://www.googleapis.com/auth/indexing',
        ],
    ],
];
```

You may also pass a JSON string or array directly when instantiating the service.

Basic usage
-----------

[](#basic-usage)

### Facade

[](#facade)

```
use Elfeffe\LaravelGoogleIndexing\Facades\LaravelGoogleIndexingFacade as LaravelGoogleIndexing;

LaravelGoogleIndexing::update('https://example.com/page');
LaravelGoogleIndexing::delete('https://example.com/page');
LaravelGoogleIndexing::status('https://example.com/page');
```

### Direct service usage

[](#direct-service-usage)

```
use Elfeffe\LaravelGoogleIndexing\LaravelGoogleIndexing;

$googleIndexing = new LaravelGoogleIndexing();

$googleIndexing->update('https://example.com/page');
```

### Custom auth config

[](#custom-auth-config)

```
use Elfeffe\LaravelGoogleIndexing\LaravelGoogleIndexing;

$googleIndexing = LaravelGoogleIndexing::forAuthConfig(
    storage_path('my-google-service-account.json')
);
```

Model indexing
--------------

[](#model-indexing)

If a model exposes a canonical URL, you can use the `GoogleIndexable` trait.

```
use Elfeffe\LaravelGoogleIndexing\Traits\GoogleIndexable;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use GoogleIndexable;

    public function getGoogleIndexingUrl(): string
    {
        return route('articles.show', $this);
    }
}
```

Then:

```
use Elfeffe\LaravelGoogleIndexing\LaravelGoogleIndexing;

$service = new LaravelGoogleIndexing();
$service->updateModel($article);
```

Helper usage
------------

[](#helper-usage)

The helper wraps the service with daily quota tracking based on successful submissions stored in `google_indexing_records`.

```
use Elfeffe\LaravelGoogleIndexing\Helpers\IndexingHelper;

$helper = app(IndexingHelper::class);

$helper->indexUrl('https://example.com/page');
$helper->indexUrls([
    'https://example.com/page-1',
    'https://example.com/page-2',
]);
$helper->indexModel($article);
```

### Quota helpers

[](#quota-helpers)

```
$helper->isQuotaExceeded();
$helper->getRemainingQuota();
```

Using the trait:

```
Article::getTodayIndexingCount();
Article::getRemainingDailyQuota();
Article::query()->needsGoogleIndexing(30)->get();
```

Stored records
--------------

[](#stored-records)

Successful requests are stored in `google_indexing_records` with:

- `url`
- `status`
- `sent_at`
- `response_data`
- `error_message`
- optional morph relation via `indexable_type` / `indexable_id`

This lets you avoid unnecessary resubmissions and track recent indexing activity.

Exceptions
----------

[](#exceptions)

Quota errors throw:

```
Elfeffe\LaravelGoogleIndexing\Exceptions\GoogleQuotaExceededException
```

You should catch it if you are bulk processing URLs.

Credits
-------

[](#credits)

- [Federico Reggiani](https://github.com/elfeffe)
- [Robin Dirksen](https://github.com/robindirksen1)
- [Famdirksen](https://famdirksen.nl)

License
-------

[](#license)

MIT. See `LICENSE.md`.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/314f3009dfa2bbeec5895253f11aeba7246e3aa8b0cd1346b5015ef15cb8f773?d=identicon)[elfeffe](/maintainers/elfeffe)

---

Top Contributors

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

---

Tags

laravelgoogleseoindexinglaravel-google-indexingElfeffe

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elfeffe-laravel-google-indexing/health.svg)

```
[![Health](https://phpackages.com/badges/elfeffe-laravel-google-indexing/health.svg)](https://phpackages.com/packages/elfeffe-laravel-google-indexing)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[neuron-core/neuron-laravel

Official Neuron AI Laravel SDK.

10710.0k](/packages/neuron-core-neuron-laravel)[thujohn/analytics

Google Analytics for Laravel 4

113108.7k1](/packages/thujohn-analytics)[schulzefelix/laravel-search-console

A Laravel package to retrieve data from Google Search Console

5037.8k1](/packages/schulzefelix-laravel-search-console)[scottybo/laravel-google-my-business

A package for Laravel which implements the Google My Business API

3360.3k](/packages/scottybo-laravel-google-my-business)

PHPackages © 2026

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