In this episode, we're kicking things off by introducing what you'll learn in this mini course: how to protect your Livewire-powered forms with Cloudflare Turnstile, a user-friendly and privacy-focused alternative to other captcha solutions. The example we'll work with is a simple newsletter subscription form where you'll be able to see exactly how Turnstile fits into the process.
First, we demo the Turnstile widget in action and peek behind the scenes at how it talks to Cloudflare's API to check whether the form submission is coming from a human. We'll also mention the package we're using to make this integration really easy.
Next, we set up a basic Laravel app using the Breeze starter kit with the Livewire stack. Step-by-step, we scaffold a newsletter sign-up page and create a full-page Livewire component. We then set up the form UI—adding an email input, a subscribe button, and basic form submission logic. We'll add some quick validation to make sure the email address is required, show inline error messages, and connect the form to Livewire's data flow.
By the end of this episode, you'll have a working newsletter signup form in place and be ready to integrate Cloudflare Turnstile in the following lessons. If you already have an existing form you'd like to protect, you can skip ahead, but this walkthrough is a great foundation for seeing how everything connects!