Google SearchConsole API for Laravel
revolution/laravel-google-searchconsole is a Laravel package for google searchconsole api for laravel.
It currently has 18 GitHub stars and 6.732 downloads on Packagist (latest version 4.2.1).
Install it with composer require revolution/laravel-google-searchconsole.
Discover more Laravel packages by revolution
or browse all Laravel packages to compare alternatives.
Last updated
https://developers.google.com/webmaster-tools
+0.1. composer should handle it well.master branch), but you can PR to old branches.composer require revolution/laravel-google-searchconsole
from https://developers.google.com/console
Enable Google Search Console API.
'client_id' => env('GOOGLE_CLIENT_ID', ''),
'client_secret' => env('GOOGLE_CLIENT_SECRET', ''),
'redirect_uri' => env('GOOGLE_REDIRECT', ''),
'scopes' => [\Google\Service\Webmasters::WEBMASTERS],
'access_type' => 'offline',
'approval_prompt' => 'force',
'prompt' => 'consent', //"none", "consent", "select_account" default:none
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID', ''),
'client_secret' => env('GOOGLE_CLIENT_SECRET', ''),
'redirect' => env('GOOGLE_REDIRECT', ''),
],
GOOGLE_APPLICATION_NAME=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT=
Subclass of Google\Service\Webmasters\SearchAnalyticsQueryRequest.
Create at app/Search
php artisan make:search:query NewQuery
Query class must have init() method.
namespace App\Search;
use Revolution\Google\SearchConsole\Query\AbstractQuery;
class NewQuery extends AbstractQuery
{
public function init(): void
{
$this->setStartDate(now()->subMonthWithoutOverflow()->toDateString());
$this->setEndDate(now()->toDateString());
$this->setDimensions(['query']);
$this->setAggregationType(['auto']);
$this->setRowLimit(100);
}
}
MIT