Community코딩 & 개발github.com

Taldres/laravel-waitlist

taldres/laravel-waitlist 대기자 명단을 출시로 전환: 등록 순서대로 배치 초대, 초대된 주소의 등록 허용, 동의한 모든 사람에게 출시 알림, 목적 달성 후 명단 삭제.

laravel-waitlist란 무엇인가요?

이 기술은 `taldres/laravel-waitlist` 패키지를 사용하는 애플리케이션에서 대기자 명단을 관리하고 출시 과정을 자동화하는 방법을 제공합니다. 개발자는 초대, 출시 알림, 명단 정리 등의 작업을 효율적으로 수행할 수 있습니다. 초대는 선착순으로 배치 처리되며, 초대된 사용자만 등록할 수 있도록 제어할 수 있습니다. 또한, 출시 후에는 모든 동의자에게 알림을 보내고 명단을 안전하게 삭제할 수 있습니다. 이 기술은 Laravel 애플리케이션에 최적화되어 있으며, CLI 명령어, PHP 코드 스니펫, 스케줄된 작업 등을 통해 유연하게 통합할 수 있습니다.

지원 대상~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 대기자 명단: 대기자 명단에서 출시까지

애플리케이션이 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()는 주요 목적이 유효한 모든 사람을 한 번씩 반환하며, 구독 취소 링크와 해당 목록에 대한 원클릭 헤더를 포함합니다($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.

관련 스킬