admin: Indexierungsstatus aus der Search Console, Kundenansicht vorbereitet und zu (Anhang 1: 1c.4, E8)

press-releases:check-index-status fragt täglich je Portal ein Kontingent
veröffentlichter Meldungen über die URL Inspection API ab, nach Alter
gestaffelt, nie geprüfte zuerst. Jede Antwort wird als Momentaufnahme in
press_release_index_checks gespeichert; der reduzierte Befund (IndexState)
trennt „noch nicht gecrawlt" von „gecrawlt, nicht indexiert".

Client authentifiziert sich als Service-Konto über ein selbst signiertes
JWT — kein Google-SDK. Admin ▸ Reports ▸ Indexierung zeigt die Verteilung
je Portal getrennt nach Direkteinreichung und Syndikation (Status-Log
source=api; Altbestand ohne Log zählt als direkt).

Das Kundenpanel heißt jetzt „Auslieferung", zeigt Sitemap-Datum und die
Abrufe durch Such- und KI-Dienste mit dem Satz „Ein Abruf ist kein Zitat";
der Google-Index-Block hängt an GSC_CUSTOMER_VISIBLE (false).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-17 14:21:51 +00:00
parent 951b6c47fa
commit 6b8728242f
17 changed files with 1324 additions and 30 deletions

View file

@ -0,0 +1,46 @@
<?php
namespace Database\Factories;
use App\Enums\IndexState;
use App\Enums\Portal;
use App\Models\PressRelease;
use App\Models\PressReleaseIndexCheck;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<PressReleaseIndexCheck>
*/
class PressReleaseIndexCheckFactory extends Factory
{
/**
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'press_release_id' => PressRelease::factory(),
'portal' => Portal::Presseecho,
'url' => 'https://presseecho.test/de/press-release/'.fake()->slug(),
'state' => IndexState::Indexed,
'verdict' => 'PASS',
'coverage_state' => 'Submitted and indexed',
'indexing_state' => 'INDEXING_ALLOWED',
'robots_txt_state' => 'ALLOWED',
'page_fetch_state' => 'SUCCESSFUL',
'last_crawl_time' => now()->subDay(),
'google_canonical' => null,
'raw' => null,
'checked_at' => now(),
];
}
public function withState(IndexState $state): static
{
return $this->state([
'state' => $state,
'verdict' => $state === IndexState::Indexed ? 'PASS' : 'NEUTRAL',
'last_crawl_time' => $state === IndexState::NotCrawled ? null : now()->subDay(),
]);
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Indexierungsstatus aus der Google Search Console (Roadmap 1c.4).
*
* Jede Antwort der URL Inspection API wird mit Zeitstempel als eigene Zeile
* gespeichert: die API liefert eine Momentaufnahme, der Verlauf lässt sich
* nicht nachträglich erzeugen. `state` ist der reduzierte Befund
* (App\Enums\IndexState), die Google-Felder bleiben daneben erhalten.
*/
return new class extends Migration
{
public function up(): void
{
Schema::create('press_release_index_checks', function (Blueprint $table) {
$table->id();
$table->foreignId('press_release_id')->constrained()->cascadeOnDelete();
$table->string('portal', 20);
$table->string('url', 500);
$table->string('state', 30);
$table->string('verdict', 30)->nullable();
$table->string('coverage_state', 160)->nullable();
$table->string('indexing_state', 60)->nullable();
$table->string('robots_txt_state', 40)->nullable();
$table->string('page_fetch_state', 60)->nullable();
$table->timestamp('last_crawl_time')->nullable();
$table->string('google_canonical', 500)->nullable();
$table->json('raw')->nullable();
$table->timestamp('checked_at');
$table->index(['press_release_id', 'portal', 'checked_at'], 'pric_release_portal_checked_idx');
$table->index(['portal', 'checked_at'], 'pric_portal_checked_idx');
$table->index(['state', 'checked_at'], 'pric_state_checked_idx');
});
}
public function down(): void
{
Schema::dropIfExists('press_release_index_checks');
}
};