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:
31
resources/js/composables/useWaitlist.js
Normal file
31
resources/js/composables/useWaitlist.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { ref } from 'vue'
|
||||
import api from '../axios.js'
|
||||
|
||||
export function useWaitlist() {
|
||||
const loading = ref(false)
|
||||
const success = ref(false)
|
||||
const error = ref(null)
|
||||
|
||||
async function submit(name, email, source = null) {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
await api.post('/waitlist', {
|
||||
name,
|
||||
email,
|
||||
source,
|
||||
referrer: document.referrer || null,
|
||||
})
|
||||
success.value = true
|
||||
} catch (e) {
|
||||
const fieldErrors = e.response?.data?.errors
|
||||
error.value = fieldErrors
|
||||
? Object.values(fieldErrors)[0][0]
|
||||
: (e.response?.data?.message || 'Something went wrong — please try again.')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return { loading, success, error, submit }
|
||||
}
|
||||
Reference in New Issue
Block a user