famdirksen / laravel-google-indexing
Index Laravel website in Google via Indexing API
Installs: 44 033
Dependents: 0
Suggesters: 0
Security: 0
Stars: 40
Watchers: 4
Forks: 10
Open Issues: 4
Requires
- php: ^7.2|^8.0
- google/apiclient: ^2.0
Requires (Dev)
- orchestra/testbench: ^6.23|^7.0
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2024-10-22 17:06:44 UTC
README
WORK IN PROGRESS, some functionalities may be changed in the future.
Request a page to be indexed by Google using the Indexing API.
Please, take a note at the allowed pages that can be index using this API at https://developers.google.com/search/apis/indexing-api/v3/quickstart.
Installation
You can install the package via composer:
composer require famdirksen/laravel-google-indexing
Next you have to follow the setup instructions from Google, this can be found here Google Indexing API documentation.
You need to make a file in your storage direct, but you can override this setting in config with the key laravel-google-indexing.google.auth_config
.
Soon we'll publish a blog post on how to setup this package.
Usage
NOTE: this package works only for verified sites in your Google Search Console account
Inform Google about a new or updated URL:
LaravelGoogleIndexing::create()->update('https://www.my-domain.com')
Delete an URL from the index:
LaravelGoogleIndexing::create()->delete('https://www.my-domain.com')
Get the status of an URL:
LaravelGoogleIndexing::create()->status('https://www.my-domain.com')
Or use the Facade
Inform Google about a new or updated URL:
LaravelGoogleIndexing::update('https://www.my-domain.com')
Delete an URL from the index:
LaravelGoogleIndexing::delete('https://www.my-domain.com')
Get the status of an URL:
LaravelGoogleIndexing::status('https://www.my-domain.com')
For dealing with multiple urls, you can pass an array with multiple updated/deleted urls:
LaravelGoogleIndexing::multiplePublish([['URL_UPDATED' => 'https://www.site.com'], ['URL_DELETED' => 'https://www.site.com/deleted-url']])
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@famdirksen.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.