PHPackages                             artisanpack-ui/google-search-console - 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. artisanpack-ui/google-search-console

ActiveLibrary

artisanpack-ui/google-search-console
====================================

Search Console performance data and UI components for ArtisanPack UI, built on the google base package.

1.0.0(1mo ago)00MITPHPPHP ^8.2CI passing

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/ArtisanPack-UI/google-search-console)[ Packagist](https://packagist.org/packages/artisanpack-ui/google-search-console)[ RSS](/packages/artisanpack-ui-google-search-console/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (3)Used By (0)

ArtisanPack UI Google Search Console
====================================

[](#artisanpack-ui-google-search-console)

Search Console performance data and drop-in UI components (Livewire, React, Vue) for the ArtisanPack UI ecosystem. Uses the shared [`artisanpack-ui/google`](https://github.com/ArtisanPack-UI/google) base package for OAuth2 authentication, token storage/refresh, and single-consent scope management, and calls the Search Console API to surface performance and coverage insights.

> **Deeper documentation** — this README covers the essentials. Full docs live under [`docs/`](docs/home.md): installation, per-framework component guides, HTTP endpoint reference, reporting API, CMS framework bridge, testing patterns, FAQ, and troubleshooting.

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

[](#requirements)

- PHP **8.2+**
- Laravel **10, 11, 12, or 13**
- [`artisanpack-ui/google`](https://github.com/ArtisanPack-UI/google) **^1.0** — installed and configured with an OAuth client, with the current user's Google account already connected
- A **verified Search Console property** (URL property or Domain property) accessible to the connected Google account
- **Livewire ^3.6** *(optional)* — required only if you use the Blade / Livewire components or the CMS-framework AdminWidget bridge

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

[](#installation)

Install the package via Composer:

```
composer require artisanpack-ui/google-search-console
```

The service provider and `GoogleSearchConsole` facade are auto-discovered by Laravel. The base [`artisanpack-ui/google`](https://github.com/ArtisanPack-UI/google) package is pulled in automatically.

Publish the config file if you want to override defaults:

```
php artisan vendor:publish --tag=google-search-console-config
```

Prerequisites
-------------

[](#prerequisites)

The Search Console API returns performance data for a **verified property** owned by (or delegated to) the connected Google account. Before the components will render data:

1. **Connect a Google account.** Install and configure `artisanpack-ui/google`, run its OAuth flow, and confirm the user has a `google_connections` row with `status = connected`.
2. **Verify the property in Search Console.** In [Google Search Console](https://search.google.com/search-console) add the site as either a **URL prefix property** (e.g. `https://example.com/`) or a **Domain property** (e.g. `sc-domain:example.com`) and complete verification (DNS TXT, HTML file, Google Analytics, etc.).
3. **Set `GSC_SITE_URL`.** Point the package at the exact property string Search Console uses: ```
    # URL property — include the trailing slash
    GSC_SITE_URL="https://example.com/"

    # Domain property — use the sc-domain: prefix
    GSC_SITE_URL="sc-domain:example.com"
    ```

    > **Multi-tenant / agency apps** should not use a global env var. Override the `SearchAnalyticsClient` binding (or pass a per-request `siteUrl` on the server side) to scope by tenant. The HTTP controllers intentionally **ignore** any `?site_url=…` query string to prevent one authenticated user from querying another tenant's property.

OAuth Scope
-----------

[](#oauth-scope)

The package contributes `https://www.googleapis.com/auth/webmasters.readonly` to the base package's shared `ScopeRegistry` via the `ap.google.scopes` filter hook. That means the base package's single OAuth consent screen automatically includes Search Console alongside every other Google service the app uses — no separate consent step, no manual scope wiring.

The scope is registered whenever the base package is installed. Applications that already granted consent before adding this package will see the base package prompt for incremental consent on the next connect.

Usage
-----

[](#usage)

### Blade / Livewire

[](#blade--livewire)

Drop the Livewire components into any Blade view. They handle their own data fetching, empty states, error states, and the "base package missing" call to action.

```
{{-- Full performance card: clicks, impressions, CTR, position, trend chart --}}

{{-- Top queries table --}}

{{-- Top pages table --}}

```

All three components accept the same three parameters:

ParameterTypeDefaultNotes`days``int``28`Clamped to the Search Console maximum (`DateRange::MAX_DAYS`).`limit` *(tables only)*`int``50`Clamped to `1000`.`siteUrl``?string``null`Overrides the configured site for this instance.### React

[](#react)

The React components live under the `react/` entrypoint. They call the package's HTTP routes and render the same performance card / tables as the Livewire components.

```
import { PerformanceCard } from '@artisanpack-ui/google-search-console/react/PerformanceCard'
import { TopQueriesTable } from '@artisanpack-ui/google-search-console/react/TopQueriesTable'
import { TopPagesTable } from '@artisanpack-ui/google-search-console/react/TopPagesTable'

export function Dashboard() {
    return (

    )
}
```

Props (all optional):

PropTypeDefaultNotes`initialDays``number``28`Initial range in days.`initialLimit` *(tables)*`number``50`Initial row limit.`siteUrl``string | null``null`Override the configured site.`baseUrl``string``/google-search-console`Override the HTTP endpoint prefix.`fetchImpl``typeof fetch``window.fetch`Injectable fetch, useful for SSR / testing.### Vue

[](#vue)

The Vue components mirror the React API and live under the `vue/` entrypoint:

```

import PerformanceCard from '@artisanpack-ui/google-search-console/vue/PerformanceCard.vue'
import TopQueriesTable from '@artisanpack-ui/google-search-console/vue/TopQueriesTable.vue'
import TopPagesTable from '@artisanpack-ui/google-search-console/vue/TopPagesTable.vue'

```

The React and Vue components share a single fetch layer (`resources/js/shared/`) so both frameworks talk to the same server payload.

### Publishing views and JS assets

[](#publishing-views-and-js-assets)

Publish the Blade views if you need to customise the markup:

```
php artisan vendor:publish --tag=google-search-console-views
```

Publish the React / Vue sources to bring them under your build pipeline:

```
php artisan vendor:publish --tag=google-search-console-js
```

### HTTP endpoints (used by the React + Vue components)

[](#http-endpoints-used-by-the-react--vue-components)

Enabled by default, mounted under the `google-search-console` prefix with `web` + `auth` middleware:

EndpointRoute name`GET /google-search-console/performance?days=28``google-search-console.performance``GET /google-search-console/top-queries?days=28&limit=50``google-search-console.top-queries``GET /google-search-console/top-pages?days=28&limit=50``google-search-console.top-pages`Disable them for headless / API-only apps in `config/google-search-console.php`:

```
'routes' => [
    'enabled' => false,
],
```

### Programmatic access

[](#programmatic-access)

```
use ArtisanPackUI\GoogleSearchConsole\Facades\GoogleSearchConsole;
use ArtisanPackUI\GoogleSearchConsole\Reporting\DateRange;
use ArtisanPackUI\GoogleSearchConsole\Reporting\PerformanceOverviewFetcher;

if ( googleSearchConsole()->hasReporting() ) {
    $fetcher = new PerformanceOverviewFetcher( googleSearchConsole()->client() );
    $data    = $fetcher->fetch( $connection, DateRange::lastDays( 28 ) );

    // $data->totals, $data->trend, $data->hasData
}
```

CMS Framework Bridge (Optional)
-------------------------------

[](#cms-framework-bridge-optional)

When [`artisanpack-ui/cms-framework`](https://github.com/ArtisanPack-UI/cms-framework) is installed, the package automatically registers three dashboard widgets with the CMS framework's `AdminWidgetManager`:

Widget typeClass`google-search-console.performance-card``Bridges\CmsFramework\AdminWidgets\PerformanceCardWidget``google-search-console.top-queries-table``Bridges\CmsFramework\AdminWidgets\TopQueriesTableWidget``google-search-console.top-pages-table``Bridges\CmsFramework\AdminWidgets\TopPagesTableWidget`Each widget wrapper extends the corresponding Livewire component and implements the CMS framework's `AdminWidgetInterface`, so the dashboard can drop them onto any admin page with no extra wiring.

The bridge is a strict **opt-in** — the wrappers are only referenced when both the CMS framework and Livewire are on the autoloader. Without the CMS framework the package still boots and behaves exactly as before.

Each widget declares the `view_google_search_console` capability. Grant that permission to any role that should see Search Console data on the dashboard.

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

[](#configuration)

Published to `config/google-search-console.php`:

KeyEnvDefaultNotes`reporting.site_url``GSC_SITE_URL`*(required)*See [Prerequisites](#prerequisites).`reporting.api_base`—`https://searchconsole.googleapis.com/webmasters/v3`Change only if Google moves the endpoint.`reporting.timeout`—`30`Seconds. Falls back to `30` if set to `0` or `null` so a stuck endpoint cannot hang the worker.`reporting.cache_ttl`—`300`Seconds. Set to `0` to disable response caching.`scopes`—`[webmasters.readonly]`Contributed to the shared `ScopeRegistry` via `ap.google.scopes`.`routes.enabled`—`true`Toggle the React/Vue HTTP routes.`routes.prefix`—`google-search-console`Prefix for the HTTP routes.`routes.middleware`—`[web, auth]`Middleware stack applied to the routes.Testing
-------

[](#testing)

```
composer install
composer test
```

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

[](#contributing)

Please [read through the contributing guidelines](CONTRIBUTING.md) to learn more about how you can contribute to this project.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

50d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelgoogleseogoogle search consolesearch consoleartisanpack-ui

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/artisanpack-ui-google-search-console/health.svg)

```
[![Health](https://phpackages.com/badges/artisanpack-ui-google-search-console/health.svg)](https://phpackages.com/packages/artisanpack-ui-google-search-console)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.1k6.4M360](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

6036.2k](/packages/erag-laravel-lang-sync-inertia)[ublabs/blade-simple-icons

A package to easily make use of Simple Icons in your Laravel Blade views.

1868.9k](/packages/ublabs-blade-simple-icons)

PHPackages © 2026

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