Skip to content

A hands-on tutorial showing how to integrate Google reCAPTCHA v3 into a Laravel 12 application for validating forms and protecting against spam and bots. Learn how to set up the site key/secret, build a custom validation rule, handle the token in your controller, and ensure only genuine users can submit your form.

Notifications You must be signed in to change notification settings

itstuffsolutions/laravel-12-google-recaptcha-v3-validation-example

Repository files navigation

Laravel 12 Select2 Ajax Autocomplete Search Example

This repository accompanies the blog post on ItStuffSolutions: Laravel 12 Select2 Ajax Autocomplete Search Example
It shows how to implement a dynamic, searchable dropdown using Select2 JS and Ajax in a Laravel 12 application.


🚀 Features

  • Live Ajax‐powered dropdown search with Select2.
  • Real‐time server filtering for large datasets.
  • Built with Laravel 12, jQuery, Select2 v4+ and Bootstrap styling.
  • Easy to integrate or adapt in your own Laravel project.

🧰 Prerequisites

  • PHP >= 8.1 (compatible with Laravel 12)
  • Composer
  • A fresh (or existing) Laravel 12 application
  • MySQL / SQLite / other supported DB configured
  • Node & npm (optional, if you compile frontend assets)
  • jQuery and Select2 included in your view

⚙️ Installation & Setup

# Clone the repo (or create your project directory)
git clone <your-repo-url>
cd <your-repo-folder>

# Install PHP dependencies
composer install

# Copy environment file and set up your DB credentials
cp .env.example .env
# Update .env:
# DB_HOST=...
# DB_DATABASE=...
# DB_USERNAME=...
# DB_PASSWORD=...

# Generate Laravel application key
php artisan key:generate

# Run migrations (and optionally seed dummy data)
php artisan migrate

# (Optional) Install Node dependencies & compile assets
npm install
npm run dev

# Serve the app locally
php artisan serve

About

A hands-on tutorial showing how to integrate Google reCAPTCHA v3 into a Laravel 12 application for validating forms and protecting against spam and bots. Learn how to set up the site key/secret, build a custom validation rule, handle the token in your controller, and ensure only genuine users can submit your form.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages