Open sourceLaravel package
Laravel Altcha
Laravel Altcha is an open-source Laravel package by Climactic that adds ALTCHA proof-of-work spam protection to forms. It is self-hosted, uses no third-party service and does no tracking.
Install
composer require climactic/laravel-altcha
php artisan vendor:publish --tag="laravel-altcha-config"- Type
- Laravel package
- Requires
- PHP 8.4 or later, Laravel 12 or 13, and the altcha npm package version 3 or later
- License
- MIT
- Maintained by
- Climactic
What it does
- One middleware
- Add the altcha middleware to any POST route to require a solved challenge.
- A validation rule
- Use the Altcha rule in a form request when you want the check with your other rules.
- A challenge endpoint
- GET /altcha is registered for you, and its path, prefix and middleware are configurable.
- Replay protection
- Each challenge works one time.
- A choice of algorithms
- PBKDF2 by default, with Argon2id and Scrypt as options.
- Frontend stubs
- React and TypeScript stubs are included. Other frameworks use the altcha-widget web component.
Example
Protect form routes with the middleware.
use Illuminate\Support\Facades\Route;
Route::post('/contact', ContactController::class)->middleware('altcha');
Route::post('/register', RegisterController::class)->middleware('altcha');- The protection is off until you set ALTCHA_ENABLED=true and an HMAC secret. It is pre-1.0.
- This package is not affiliated with Laravel or ALTCHA. ALTCHA is a trademark of Daniel Regeci.
Questions about Laravel Altcha
What is Laravel Altcha?
Laravel Altcha is an open-source Laravel package by Climactic that adds ALTCHA proof-of-work spam protection to forms. It is self-hosted, uses no third-party service and does no tracking.
How do I install Laravel Altcha?
Run "composer require climactic/laravel-altcha". It needs PHP 8.4 or later, Laravel 12 or 13, and the altcha npm package version 3 or later.
Is Laravel Altcha free to use?
Yes. Laravel Altcha is open source under the MIT license, and the source code is on GitHub at github.com/Climactic/laravel-altcha.
Who maintains Laravel Altcha?
Climactic, a venture studio that builds and operates its own software products, maintains Laravel Altcha.
More open source from Climactic
- laravel-credits A ledger-based Laravel package for managing credit-based systems in your application. Runs in Markdown Anything and ColorBuk
- veer Inertia.js server adapter for Rust. Return typed props from axum handlers and render React, Vue or Svelte pages.
- laravel-spam Block spam signups in Laravel with disposable-email, blocklist and StopForumSpam checks.
- laravel-polar Laravel SDK for Polar.sh. Adds subscriptions, one-time payments, and license keys to a Laravel app. Runs in Markdown Anything and ColorBuk
- pixelserve Self-hosted image proxy and transformer. Resize, crop, and reformat images on demand, and generate Open Graph images. Runs in Markdown Anything and ColorBuk