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

Taldres/laravel-waitlist: ウェイトリストからローンチまで

taldres/laravel-waitlist ウェイトリストをローンチに変換します。申し込み順にバッチでユーザーを招待し、招待されたアドレスが登録できるようにし、同意した全員にローンチを告知し、目的が達成されたらリストを消去します。

laravel-waitlist: ウェイトリストからローンチまで とは?

このスキルは、Laravelアプリケーションで `taldres/laravel-waitlist` パッケージを使用している場合に、ウェイトリストの管理を「単なる登録」から「完全な招待・ローンチ・クリーンアップフロー」へと拡張する方法を提供します。早期アクセス招待の段階的な送信、招待されたユーザーのみの登録許可、全同意ユーザーへのローンチ告知、そして目的達成後のリスト消去を実現します。パッケージ自体は招待状態を持たないため、このスキルはアプリケーション側で `invited_at` カラムを追加し、`ScopedWaitlist` マクロを使って申し込み順に招待を実装します。さらに、`recipients()` を利用したローンチ告知メールの一斉送信と、`forgetAll()` による安全なリスト消去の手順も含みます。

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

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

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

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

ドキュメント

Laravel Waitlist: ウェイトリストからローンチへ

taldres/laravel-waitlist を使用するアプリケーションで、ユーザーを段階的に受け入れる際にこのスキルを使用します:早期アクセス招待、ローンチ告知、およびその後のクリーンアップ。このパッケージは意図的に invited 状態を持たないため、それをアプリケーション上に構築します。

主な目的

  • 目的が有効なアドレスに対してのみ招待と告知を行い、アプリケーションに招待記録を残し、リストの目的が達成されたら消去する

ワークフロー

1. 独自のモデルに招待を記録する

// アプリケーション内のマイグレーション
Schema::table('waitlist_entries', function (Blueprint $table) {
    $table->timestamp('invited_at')->nullable();
});
namespace App\Models;

use Taldres\Waitlist\Models\WaitlistEntry as BaseEntry;

class WaitlistEntry extends BaseEntry
{
    public function __construct(array $attributes = [])
    {
        $this->mergeFillable(['invited_at']);   // 親がモデルを埋める前に実行

        parent::__construct($attributes);
    }

    protected function casts(): array
    {
        return parent::casts() + ['invited_at' => 'datetime'];
    }
}
// config/waitlist.php
'model' => App\Models\WaitlistEntry::class,

サブクラスが booted() をオーバーライドする場合は、parent::booted() を呼び出す必要があります。

2. 次のバッチを先着順で招待する

use Illuminate\Support\Facades\Mail;
use Taldres\Waitlist\Facades\Waitlist;
use Taldres\Waitlist\ScopedWaitlist;

// AppServiceProvider::boot()
ScopedWaitlist::macro('inviteNext', function (int $count = 10) {
    /** @var ScopedWaitlist $this */
    return $this->entries()
        ->whereConsentedTo('waitlist')   // リストの主目的:確認済みでまだリストに残っている
        ->whereNull('invited_at')
        ->oldest()
        ->limit($count)
        ->get()
        ->each(function ($entry) {
            $entry->forceFill(['invited_at' => now()])->save();
            Mail::to($entry->email)->queue(new YouAreInMail($entry, Waitlist::unsubscribeUrl($entry)));
        });
});
Waitlist::for('beta')->inviteNext(25);   // スケジュールされたコマンド、管理画面、またはTinkerから実行

YouAreInMail はトークン付きの購読解除URLを保持します。ShouldBeEncrypted を実装することで、キューに入れられたメールが暗号化されて保存されるようにします。

3. 招待されたアドレスを許可する

$entry = Waitlist::for('beta')->find($request->string('email')->value());

abort_unless($entry?->invited_at !== null && $entry->hasConsentFor('waitlist'), 403);

find() は離脱したアドレスも返します。hasConsentFor() またはステータスを確認してください。

4. ローンチを告知する

use Taldres\Waitlist\Support\Recipient;

Waitlist::for('beta')->recipients()->each(
    fn (Recipient $recipient) => Mail::to($recipient->email)->locale($recipient->locale)->queue(new LaunchMail($recipient)),
);

recipients() は、主目的が有効な全ユーザーを1回ずつ返し、そのリスト用の購読解除リンクとワンクリックヘッダーを提供します($recipient->unsubscribeUrl(), $recipient->listUnsubscribeHeaders())。

5. リストの目的が達成されたら消去する

ウェイトリストの目的(「早期アクセスが公開されたらメールで知らせて」)が達成されたら、次のように消去します:

php artisan waitlist:forget --list=beta --all     # 確認を求めます;--force でターミナルなしで実行

または Waitlist::for('beta')->forgetAll()。これにより、ニュースレターなどのオプションの同意も含め、リストのすべてのエントリとそのすべての同意が消去されます。同意は移動できません。ニュースレターを維持したい場合は、そのユーザーは自分で参加した別のリスト(例:news リストに newsletter を主目的として設定)を通じてのみ保持できます。消去する前に、そのリストへの参加を招待してください。

ルール、参考情報、テンプレート

例

  • 「毎週月曜日にベータウェイトリストから50人を招待する」:ステップ2のマクロをスケジュールされたコマンドで使用。
  • 「早期アクセス中はウェイトリストに登録した人のみ登録を許可する」:登録コントローラでステップ3を実装。
  • 「ローンチしたのでウェイトリストをクリーンアップする」:ステップ4の後、ステップ5を実行。

アンチパターン

  • whereConsentedTo() なしで entries() から招待する:確認されていないアドレスや離脱した人が含まれます。
  • ローンチ後も「念のため」リストを永久に保持する。
  • パッケージのステータスや終了理由に invited や rejected を追加する。
  • 招待メールに管理リンクを含める。

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

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

Build waitlist statistics with taldres/laravel-waitlist: signups and confirmations per day for charts, totals and confirmation rates for a period, the confirmed count on any past day, and how many people are on a list right now, for dashboards, admin pages and API endpoints.

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.

関連スキル