Communityコーディング&開発github.com

Taldres/laravel-waitlist: レポート機能

taldres/laravel-waitlist を使用したアプリケーションで、ウェイトリストの統計情報(日別登録数・確認数、期間の合計・確認率、過去の確認済み数、現在のリスト人数)をダッシュボード、管理画面、APIエンドポイント向けに取得します。

laravel-waitlist: レポート機能 とは?

このスキルは、Laravel アプリケーションで `taldres/laravel-waitlist` パッケージを使ったウェイトリストのレポート機能を提供します。ダッシュボードやチャート、管理ウィジェット、週次レポートなどに必要な統計情報を取得するための統一的な手法を定義しており、アクティビティログとスナップショットを適切に使い分けることで正確な数値を返します。 主な機能として、`report()` メソッドで期間指定の合計値(登録数、確認数、確認率など)、`daily()` で日別系列、`confirmedOn()` で過去の確認済み数を取得できます。また、`snapshot()` で現在のリスト状態(保留中、確認済み、未購読)を取得可能です。スコープはプロジェクト単位、リスト単位、目的単位で絞り込めます。 このスキルはデータの一貫性と正確性を重視しています。消去やリテンションによる変動を避けるため、過去の期間の集計には必ずアクティビティログを使用し、現在のリスト人数にはスナップショットを使用するなど、適切なソースを選択するルールを定義しています。時間帯は `app.timezone` に基づき、日をまたぐイベントの扱いも明確です。 反パターンとして、`WaitlistEntry` 行の直接カウントや、`Waitlist::count()` の誤用、エンジン固有の SQL 関数での日付計算、目的フィルター時の登録数や確認数の期待などを禁止しています。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Taldres/laravel-waitlist/tree/HEAD/resources/boost/skills/laravel-waitlist-reporting

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Laravel Waitlist: レポート機能

このスキルは、taldres/laravel-waitlist を使用するアプリケーションがウェイトリストに関する数値を必要とする場合(ダッシュボード、チャート、管理ウィジェット、週次レポートなど)に使用します。

主な目標

  • 各質問に適切なソースから回答する:「何が起こったか」はアクティビティログ、「現在誰がリストにいるか」は snapshot()

ワークフロー

1. ソースを選択する

Waitlist::for('beta')->report()->between('2026-08-01', '2026-08-31')->totals();
// 「8月の確認済み数: 230」: アクティビティログ、過去の事実

Waitlist::for('beta')->snapshot();
// 「現在リストにいる人数: 197」: アドレス、現在の事実

後で消去が発生しても、最初の数値が変わることはありません。カウントは「人数」ではなく「ステップ」です。誰かが離脱して戻ってきた場合、確認は2回カウントされます。

2. 現在: snapshot()

$snapshot = Waitlist::for('beta')->snapshot();

$snapshot->pending;       // 確認待ち
$snapshot->confirmed;     // リストに登録済み
$snapshot->unsubscribed;  // 離脱済み(まだ保持期間内)
$snapshot->active();      // pending + confirmed
$snapshot->total();
$snapshot->toArray();     // JSON対応、プロジェクトとリスト情報を含む

3. 期間: 合計値

use Taldres\Waitlist\Enums\ActivityType;
use Taldres\Waitlist\Enums\EntryStatus;

$totals = Waitlist::for('beta')->report()->since(30)->totals();   // 過去30日間

$totals->signups();                       // 購読 + 再購読
$totals->of(ActivityType::Confirmed);
$totals->of(ActivityType::Unsubscribed, from: EntryStatus::Confirmed);  // 確認後に離脱
$totals->confirmationRate();              // ?float、誰も登録していない場合は null
$totals->confirmedChange();               // 確認済み数の正味変化量

4. チャート: 日別系列

$series = Waitlist::for('beta')->report()->since(30)->daily()->fillGaps();

foreach ($series as $day) {
    $day->date;                       // CarbonImmutable
    $day->signups();
    $day->of(ActivityType::Confirmed);
}

$series->toArray();   // [{date, subscribed, resubscribed, confirmation_requested, confirmation_mailed, confirmed, unsubscribed, expired, erased, consent_granted, consent_withdrawn}]

fillGaps() はアクティビティのない日を追加します。チャートには必須です。

5. 過去の日の確認済み数

Waitlist::for('beta')->report()->confirmedOn('2026-09-30');   // その日の終わり時点

ログが遡れる限り正確で、日単位です。今日の値は snapshot()->confirmed と等しくなります。

6. スコープ

  • Waitlist::report(): デフォルトプロジェクトのすべてのリスト;->forList('beta', 'launch') で絞り込み。
  • Waitlist::for('beta')->report(): 1つのリスト。
  • Waitlist::project('acme')->report(): 1つのプロジェクト;Waitlist::allProjects()->report(): すべて。
  • ->forPurpose('newsletter'): オプションのパーパスのみの許諾と取り消し; 登録、確認、離脱にはパーパスは含まれず除外されます。
  • since() や between() がない場合、保存されているすべてのデータが対象。

ルール、参考資料、テンプレート

  • 1日は常に app.timezone で終了します:各行は書き込み時にその日(occurred_on)を保存し、レポートはそのタイムゾーンでグループ化し、期間を解決します。消去は正確な時刻をクリアするため、最初の登録前に app.timezone を設定しておいてください。後で変更しても既存の行の日付は変わらず、後続の行のみに影響します。UTC の場合、ベルリン夏時間の 23:30 の登録は翌 UTC 日に属します:これは明確な区切りであり、誤カウントではありません。
  • レポートは1つのグループ化クエリです。ダッシュボードが頻繁にポーリングする場合は、アプリケーション側でキャッシュしてください。
  • 残りのログは最小化されており、匿名ではありません。レポートはそれを必要とする人のために保持してください。
  • ガイド: https://github.com/Taldres/laravel-waitlist/blob/main/docs/reporting.md

例

  • 「管理画面に先月の日別登録数を表示」:ステップ4をチャートライブラリ用に JSON で出力。
  • 「各月末に確認済みの人数は何人いたか?」:各月末に confirmedOn() を使用。
  • 「今週のベータリストの変換率」:report()->since(7)->totals()->confirmationRate()。

アンチパターン

  • 過去の期間に対して WaitlistEntry 行をカウントすること。消去と保持期間により数値が変わります。
  • 「リストにいる」の意味で Waitlist::for($list)->count() を使用すること:これには離脱した人も含まれます。snapshot()->confirmed または active() を使用してください。
  • エンジン固有の関数で SQL 上で日付を計算すること。ログには既にレポート用の日が保存されています。
  • パーパスでフィルタリングしたレポートに登録数や確認数が含まれると期待すること。

Individual skills in this repo

This repo contains 13 individual skills — each has its own dedicated page.

Taldres/laravel-waitlist

Use this skill when reviewing Laravel package compatibility across composer constraints, PHP versions, Laravel versions, Testbench versions, dependency stability lanes, Windows CI, or matrix-sensitive code and workflow changes.

Taldres/laravel-waitlist

Use this skill when creating or updating the bundled Laravel Boost skill under resources/boost/skills from the package implementation and package documentation. Trigger after public APIs, commands, config, routes, views, publish tags, README content, or examples change.

Taldres/laravel-waitlist

Use this skill when preparing Laravel package releases: CHANGELOG.md updates, generated release notes, GitHub release workflows, version checks, tags, release validation, or release automation changes. Never publish autonomously.

Taldres/laravel-waitlist

Use this skill when adding Laravel package capabilities or wiring them through the service provider: commands, migrations, routes, config merges, views, translations, assets, middleware, publish tags, workbench files, or console-only behavior.

Taldres/laravel-waitlist

Use this skill when writing, editing, fixing, or reviewing package tests with Pest 4/5 and Orchestra Testbench, including TDD, feature tests, unit tests, type coverage, arch tests, workbench behavior, commands, routes, config, migrations, and publishable resources.

Taldres/laravel-waitlist

Integrate taldres/laravel-waitlist in a Laravel application: define purposes, lists and fields, build the signup form, send the confirmation mail from events, add a preference page, and keep consent, retention and encryption intact.

Taldres/laravel-waitlist

Build the pages of a taldres/laravel-waitlist integration: the signup form with the registered wording, and the confirm, unsubscribe and preference pages, either in Laravel controllers (Blade, Livewire, Inertia) or in an SPA or static site over the package's JSON API, including CORS and bot protection.

Taldres/laravel-waitlist

Turn a taldres/laravel-waitlist waitlist into a launch: invite people in batches in signup order, let invited addresses register, announce the launch to everyone who agreed, and erase the list once its purpose is fulfilled.

Taldres/laravel-waitlist

Send the mails of a taldres/laravel-waitlist integration: the double opt-in confirmation, the preference page link, a welcome mail, launch mails and newsletters to the people who agreed, with the right unsubscribe links, one-click headers and a sender per project.

Taldres/laravel-waitlist

Operate a taldres/laravel-waitlist installation: answer access and erasure requests, withdraw a purpose on request, apply retention, erase a list once its purpose is fulfilled, rotate APP_KEY with waitlist:rekey, export a list, and check the setup before going live.

Taldres/laravel-waitlist

Run the waitlists of several products in one Laravel app with taldres/laravel-waitlist projects: define projects, scope facade calls with project(), resolve the project of HTTP signups, send mail per project, handle requests across all projects, or keep projects in a database for a central waitlist API.

Taldres/laravel-waitlist

Keep a newsletter tool such as Brevo, Mailchimp or Mailcoach in step with a taldres/laravel-waitlist waitlist: add confirmed contacts per purpose, remove them on withdrawal and erasure, and carry unsubscribes made at the provider back into the waitlist via a webhook.

Taldres/laravel-waitlist

Write feature tests for an application's taldres/laravel-waitlist integration: get the plain tokens from events, assert the confirmation and other mails, test the signup, confirm and unsubscribe flows in PHP and over the package's HTTP routes, and bypass rate limits and bot checks in tests.

関連スキル