Download the PHP package wonchoe/laravel-gsc-manager without Composer
On this page you can find all versions of the php package wonchoe/laravel-gsc-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wonchoe/laravel-gsc-manager
More information about wonchoe/laravel-gsc-manager
Files in wonchoe/laravel-gsc-manager
Package laravel-gsc-manager
Short Description Reusable Laravel package for discovering, storing, and syncing Google Search Console data via service account JSON credentials.
License MIT
Informations about the package laravel-gsc-manager
Laravel GSC Manager
Reusable Laravel package for discovering, storing, approving, and syncing Google Search Console data with Google Service Account JSON files.
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
google/apiclient^2.0- One or more Google service accounts added to Search Console property permissions
This package does not use API keys. Authentication is always done with service account JSON credentials.
Installation
For local path development:
Service Account JSON Files
Put one or more JSON files in:
The file names can be anything. Each JSON file is treated as one service account and one group of accessible Search Console sites.
Add each service account client_email to the relevant Google Search Console property permissions. The package reads client_email and project_id, but never returns or logs private_key.
Discovery
Discovery scans storage/app/private/gsc-keys, upserts credentials, calls Search Console sites.list, and stores discovered properties. Broken JSON files are logged and skipped without stopping the batch.
Approving Sites
By default, discovered sites are inactive until approved:
You can also approve through your own admin UI or directly in the database by setting status=approved and active=true.
Sync Search Analytics
Supported search types:
webimagevideonewsdiscovergoogleNews
Supported dimensions:
datehourquerypagecountrydevicesearchAppearance
Search Analytics uses startRow pagination when enabled and stores clicks, impressions, ctr, position, dynamic dimension values, a row hash, and the raw API row.
Discover Search Appearances
Search Appearance names are not hardcoded. The package discovers them by querying Search Analytics grouped by searchAppearance.
Sync Sitemaps
Sitemap sync stores sitemap path, submitted/downloaded timestamps, warnings, errors, sitemap index status, pending status, contents, submitted counts, and deprecated indexed counts if Google returns them.
Submitting and deleting sitemaps require full scope and are disabled by default:
URL Inspection
The package calls:
Stored URL Inspection fields include verdict, coverage state, robots state, indexing state, page fetch state, Google/user canonicals, crawl time, crawled-as value, sitemap URLs, referring URLs, inspection result link, AMP/mobile/rich results raw payloads, and the full raw response.
Scheduler Example
API Routes
Default prefix: /api/gsc
You can change the route URL prefix and route name prefix in config/gsc-manager.php:
All responses use:
Credential API responses expose safe fields only: id, file_name, client_email, project_id, active, last_discovered_at, and last_synced_at.
Supported GSC Data
- Sites/properties from
sites.list - Search Analytics clicks, impressions, CTR, and position
- Search types:
web,image,video,news,discover,googleNews - Dimensions:
date,hour,query,page,country,device,searchAppearance - Sitemaps: submitted/downloaded timestamps, warnings, errors, contents
- URL Inspection: index status, canonicals, crawl time, robots/indexing state, AMP/mobile/rich results raw payloads
- Indexing API: optional and disabled by default
Indexing API Warning
Google officially limits the Indexing API to pages with JobPosting or BroadcastEvent embedded in VideoObject. This package never runs Indexing API automatically for normal pages. It is disabled by default and guarded by indexing_api.allowed_content_only.
Security Notes
- Protect API routes with
auth:sanctum, admin middleware, or your internal authorization layer. - Keep
storage/app/private/gsc-keysoutside the public webroot. - Never expose service account JSON files through web routes.
- The package redacts
private_key, tokens, and secrets from formatted errors. - One broken JSON or one failed site sync is logged and skipped without crashing the whole batch.
Configuration
Publish the config:
Key options:
credentials_path: where JSON files are scannedauto_approve_discovered_sites: whether new sites become active immediatelydefault_scope: usuallyreadonlyanalytics.row_limit: capped at 25000analytics.paginate: enablesstartRowpaginationurl_inspection.daily_limit_per_siteurl_inspection.qpm_limit_per_siterate_limits.max_retries
All versions of laravel-gsc-manager with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
google/apiclient Version ^2.0