Add pricing-page waitlist (name + email signup)
Replaces the disabled "Coming soon" buttons on the pricing page with a waitlist band so visitors can be notified when alerts launch — separate from registered users. - waitlist_subscribers table (name, email unique, source, referrer) - WaitlistService::subscribe — normalises email, idempotent - Public POST /api/waitlist (throttle:10,1), thin controller + form request - Read-only Filament resource with streamed CSV export - Vue: useWaitlist composable + WaitlistForm, rendered below the grid while any tier is still "coming soon"; sends source + document.referrer Announcement send mechanism deferred to a later task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
29
app/Services/WaitlistService.php
Normal file
29
app/Services/WaitlistService.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\WaitlistSubscriber;
|
||||
|
||||
final class WaitlistService
|
||||
{
|
||||
/**
|
||||
* Add someone to the feature-launch waitlist.
|
||||
*
|
||||
* Idempotent: re-subscribing an existing email is a no-op that returns the
|
||||
* original subscriber unchanged — original meta (source, referrer) is kept,
|
||||
* never a duplicate row or an error.
|
||||
*/
|
||||
public function subscribe(
|
||||
string $name,
|
||||
string $email,
|
||||
?string $source = null,
|
||||
?string $referrer = null,
|
||||
): WaitlistSubscriber {
|
||||
$email = strtolower(trim($email));
|
||||
|
||||
return WaitlistSubscriber::firstOrCreate(
|
||||
['email' => $email],
|
||||
['name' => $name, 'source' => $source, 'referrer' => $referrer],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user