In this episode, we focus on getting the Cloudflare Turnstile package set up in our Laravel project. First, we pull in the necessary package using Composer, following the official instructions. Next, we dive into configuring the package by adding the site key and secret key we grabbed earlier into our config/services.php
file, making sure they're hooked up properly.
After configuring the keys, we shift our attention to pulling in the required Turnstile script. Since the widget needs its script loaded on every page where it will be used, we explore a couple of different ways to include it. If you're using Laravel Breeze, you'll likely want to add the script to your main layout files, such as app.blade.php
or the guest layout for login and registration pages.
By the end of this episode, we've got the package installed and the scripts in place, so we're ready to start rendering the widget itself in the next episode!