Zum Hauptinhalt springen

Admin & System Models

System-Models für Tag-Management, Google API Quota-Tracking, AI-Detection-Logging, E-Mail-Protokollierung und das CMS. Zusätzlich existieren die Tabellen dashboard_leaderboard_snapshots, dashboard_global_snapshots und queue_metrics ohne dediziertes Model.

BlockedTag

Gesperrte Tags, die aus Explore-Ergebnissen und Profil-Tags herausgefiltert werden. Verwendet einen 1h-Cache für schnellen Zugriff.

Tabelle: blocked_tags

FeldTypNullableBeschreibung
idbigintPKPrimary Key
tagstringneinGesperrter Tag (unique)
blocked_bybigint (FK)jaAdmin-User, der den Tag gesperrt hat
blocked_atdatetimejaZeitpunkt der Sperre
reasonstringjaSperrgrund
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Relations:

MethodeTypRelated ModelFKBeschreibung
blocker()belongsToUserblocked_bySperrender Admin

Casts: blocked_at → datetime

Methoden:

MethodeReturnBeschreibung
cachedList() (static)CollectionAlle gesperrten Tags (1h Cache)
flushCache() (static)voidCache invalidieren

Location: app/Models/BlockedTag.php


TagAlias

Tag-Umbenennungen (Source-Tag wird auf Target-Tag gemappt). Verwendet einen 1h-Cache mit statischer resolve()-Methode.

Tabelle: tag_aliases

FeldTypNullableBeschreibung
idbigintPKPrimary Key
source_tagstringneinQuell-Tag (unique)
target_tagstringneinZiel-Tag
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Methoden:

MethodeReturnBeschreibung
cachedMap() (static)CollectionAlle Aliases als Key-Value-Map (1h Cache)
resolve($tag) (static)stringLöst einen Tag auf (folgt Alias-Chain)
flushCache() (static)voidCache invalidieren

Location: app/Models/TagAlias.php


TagConsolidationLog

Protokoll der Tag-Konsolidierung. Aufzeichnung welche Tags zusammengefasst wurden, mit Confidence-Score und betroffenen Profilen. Verwendet MassPrunable -- Einträge älter als 1 Jahr werden automatisch gelöscht.

Tabelle: tag_consolidation_logs

FeldTypNullableBeschreibung
idbigintPKPrimary Key
batch_idstringneinBatch-Identifier (gruppiert zusammengehörige Aktionen)
source_tagstringneinKonsolidierter Quell-Tag
target_tagstringneinZiel-Tag
actionstringneinAktion (merge, rename, delete)
confidencefloatjaConfidence-Score der Konsolidierung
reasonstringjaBegründung
affected_profilesintegerjaAnzahl betroffener Profile
statusstringneincompleted, failed
error_messagetextjaFehlermeldung bei Fehler
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Traits: MassPrunable -- löscht automatisch Einträge älter als 1 Jahr.

Location: app/Models/TagConsolidationLog.php


GoogleApiQuotaLimit

Gespeicherte Quota-Limits des Google Cloud Projekts. Wird per google:sync-api-usage (stündlich) aktualisiert.

Tabelle: google_api_quota_limits

FeldTypNullableBeschreibung
idbigintPKPrimary Key
project_idstringneinGoogle Cloud Projekt-ID
servicestringneinAPI-Service (z.B. youtube.googleapis.com)
quota_metricstringneinQuota-Metrik-Name
display_namestringjaAnzeigename
unitstringjaEinheit
limit_valueintegerneinLimit-Wert
effective_limit_valueintegerjaEffektiver Limit-Wert
rawjsonjaRohdaten der API-Response
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Casts: limit_value → integer, effective_limit_value → integer, raw → array

Location: app/Models/GoogleApiQuotaLimit.php


GoogleApiQuotaUsage

Täglicher Quota-Verbrauch pro Service und Metrik. Kann nach Credential aufgeschlüsselt werden (Multi-Key-Rotation).

Tabelle: google_api_quota_usages

FeldTypNullableBeschreibung
idbigintPKPrimary Key
project_idstringneinGoogle Cloud Projekt-ID
servicestringneinAPI-Service
quota_metricstringneinQuota-Metrik-Name
datedateneinVerbrauchsdatum
used_valueintegerneinVerbrauchter Wert
by_credentialjsonjaAufschlüsselung nach Credential
collected_atdatetimejaErfassungszeitpunkt
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Casts: date → date, used_value → integer, by_credential → array, collected_at → datetime

Location: app/Models/GoogleApiQuotaUsage.php


AiDetectionLog

Protokoll aller AI-Erkennungsläufe (Sprache, Land, Beschreibung) per Gemini API. Erfasst Tokens, Dauer und Ergebnis.

Tabelle: ai_detection_logs

FeldTypNullableBeschreibung
idbigintPKPrimary Key
social_profile_idbigint (FK)jaZugehöriges Profil (nullable seit Migration 96)
typestringneinDetection-Typ (language, country, description)
modelstringneinVerwendetes AI-Model
input_datajsonneinEingabedaten
output_datajsonjaAusgabedaten (bei Erfolg)
raw_responsejsonjaRohe API-Response
statusstringneinsuccess, failed, error
error_messagetextjaFehlermeldung
tokens_usedintegerjaVerbrauchte Tokens
duration_msintegerjaDauer in Millisekunden
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Relations:

MethodeTypRelated ModelFKBeschreibung
socialProfile()belongsToSocialProfilesocial_profile_idZugehöriges Profil

Casts: input_data → array, output_data → array, raw_response → array, tokens_used → integer, duration_ms → integer

Accessors: confidence, detected_language, detected_country, duration_for_humans

Methoden: isSuccess()

Location: app/Models/AiDetectionLog.php


MailLog

Protokolliert versandte E-Mails. Keine automatischen Timestamps -- nur created_at wird manuell gesetzt.

Tabelle: mail_log

FeldTypNullableBeschreibung
idbigintPKPrimary Key
user_idbigint (FK)jaEmpfänger-User
mail_typestringneinE-Mail-Typ
recipientstringneinEmpfänger-Adresse
subjectstringjaBetreff
statusstringneinsent, failed
error_messagetextjaFehlermeldung bei Fehler
created_atdatetimeneinVersandzeitpunkt

Relations:

MethodeTypRelated ModelFKBeschreibung
user()belongsToUseruser_idEmpfänger-User

Timestamps: false (nur created_at manuell)

Casts: created_at → datetime

Location: app/Models/MailLog.php


Page

CMS-Seiten mit Audit-Trail. URL-Format: /{slug}_p{id} (z.B. /impressum_p1). Unterstützt Navigation in Header, Footer und Sidebar.

Tabelle: pages

FeldTypNullableBeschreibung
idbigintPKPrimary Key
slugstringneinURL-Slug
titlestringneinSeitentitel
contenttextjaSeiteninhalt (Markdown/HTML)
meta_descriptiontextjaMeta-Description
is_meta_autobooleanneinMeta-Description automatisch generiert
is_draftbooleanneinEntwurf
is_review_neededbooleanneinReview benötigt
is_publishedbooleanneinVeröffentlicht
nav_priorityintegerneinNavigations-Priorität
show_in_headerbooleanneinIn Header-Navigation anzeigen
show_in_footerbooleanneinIn Footer-Navigation anzeigen
show_in_sidebarbooleanneinIn Sidebar-Navigation anzeigen
created_bybigint (FK)jaErsteller
updated_bybigint (FK)jaLetzter Bearbeiter
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Relations:

MethodeTypRelated ModelFKBeschreibung
creator()belongsToUsercreated_byErsteller
updater()belongsToUserupdated_byLetzter Bearbeiter

Traits: Auditable (OwenIt\Auditing) -- protokolliert alle Änderungen.

Scopes:

ScopeBeschreibung
published()Nur veröffentlichte Seiten
forHeader()Header-Navigation
forFooter()Footer-Navigation
forSidebar()Sidebar-Navigation
drafts()Nur Entwürfe
needsReview()Review benötigt

Accessors: url, canonical_path, status, status_color, status_label

Methoden: generateSlug(), generateMetaDescription(), parseUrlPath() (static), findByIdWithRedirectCheck() (static)

URL-Format: /{slug}_p{id} -- z.B. /impressum_p1, /datenschutz_p2

Location: app/Models/Page.php


UserBlock

Audit-Log fuer User-Blocking-Aktionen (Block/Unblock). Jede Aktion wird mit Admin-ID, Grund und Zeitstempel protokolliert.

Tabelle: user_blocks

FeldTypNullableBeschreibung
idbigintPKPrimary Key
user_idbigint (FK)neinBetroffener User
admin_idbigint (FK)neinHandelnder Admin
actionstringneinblocked oder unblocked
reasontextjaBegruendung
created_atdatetimeneinErstellt am
updated_atdatetimeneinAktualisiert am

Relations:

MethodeTypRelated ModelFKBeschreibung
user()belongsToUseruser_idBetroffener User
admin()belongsToUseradmin_idHandelnder Admin

Indexes: user_id, created_at

Location: app/Models/UserBlock.php


Tabellen ohne Model

dashboard_leaderboard_snapshots

Tägliche Top-100-Snapshots pro Watcher, Workspace und Owner. Wird per BuildDashboardLeaderboardSnapshots-Command befüllt und vom LeaderboardPriorityService gelesen. Keine Eloquent-Abstraktion -- ausschließlich per Query Builder.

Location: app/Console/Commands/BuildDashboardLeaderboardSnapshots.php, app/Services/Dashboard/LeaderboardPriorityService.php

dashboard_global_snapshots

Globale Leaderboard-Daten mit Tier-Aufschlüsselung. Wird per BuildGlobalLeaderboardSnapshots-Command befüllt. Basis für die TopsFlops-Seite.

Location: app/Console/Commands/BuildGlobalLeaderboardSnapshots.php, app/Livewire/TopsFlops/Index.php

queue_metrics

Performance-Snapshots der Queue-Worker. Wird per SnapshotQueueMetrics-Command erfasst und im Admin Queue-Metrics-Chart angezeigt.

Location: app/Console/Commands/SnapshotQueueMetrics.php, app/Livewire/Admin/LogQueue/QueueMetricsChart.php