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:
27
app/Http/Controllers/Api/WaitlistController.php
Normal file
27
app/Http/Controllers/Api/WaitlistController.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Api\StoreWaitlistRequest;
|
||||
use App\Services\WaitlistService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class WaitlistController extends Controller
|
||||
{
|
||||
public function __construct(private readonly WaitlistService $waitlist) {}
|
||||
|
||||
public function store(StoreWaitlistRequest $request): JsonResponse
|
||||
{
|
||||
$this->waitlist->subscribe(
|
||||
name: $request->string('name')->toString(),
|
||||
email: $request->string('email')->toString(),
|
||||
source: $request->filled('source') ? $request->string('source')->toString() : null,
|
||||
referrer: $request->filled('referrer') ? $request->string('referrer')->toString() : null,
|
||||
);
|
||||
|
||||
return response()->json([
|
||||
'message' => "You're on the list — we'll email you when alerts go live.",
|
||||
], 201);
|
||||
}
|
||||
}
|
||||
26
app/Http/Requests/Api/StoreWaitlistRequest.php
Normal file
26
app/Http/Requests/Api/StoreWaitlistRequest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreWaitlistRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', 'max:255'],
|
||||
'source' => ['nullable', 'string', 'max:64'],
|
||||
'referrer' => ['nullable', 'string', 'max:2048'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user