PHPackages                             artisanbarista/laravel-altcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. artisanbarista/laravel-altcha

ActiveLibrary[API Development](/categories/api)

artisanbarista/laravel-altcha
=============================

A Laravel server implementation for Altcha.

v1.0.0(1y ago)0621[3 PRs](https://github.com/artisanbarista/laravel-altcha/pulls)MITPHPPHP ^8.1CI passing

Since Sep 25Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/artisanbarista/laravel-altcha)[ Packagist](https://packagist.org/packages/artisanbarista/laravel-altcha)[ Docs](https://github.com/artisanbarista/laravel-altcha)[ GitHub Sponsors]()[ RSS](/packages/artisanbarista-laravel-altcha/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (5)Used By (0)

Laravel Altcha.
===============

[](#laravel-altcha)

[![Latest Version on Packagist](https://camo.githubusercontent.com/56628881b6f7722d4e0d0c9e306b2430497619ccdedb1775f4abd8fdebafa529/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772616e74686f6c6c652f6c61726176656c2d616c746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grantholle/laravel-altcha)[![GitHub Tests Action Status](https://camo.githubusercontent.com/441818ebd793f316d8936787ba2fcb8f30f431b78a1b6f64f8a45aa52a386b9c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772616e74686f6c6c652f6c61726176656c2d616c746368612f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/grantholle/laravel-altcha/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6872bad803673e0917d0356b9d3852f80f33beaaad3b69fd7d5e314619e09d86/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6772616e74686f6c6c652f6c61726176656c2d616c746368612f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/grantholle/laravel-altcha/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b60dc4e079bd4a7263044792ce7c76c9724f4871d943f063ec1d3e0020ed4a98/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772616e74686f6c6c652f6c61726176656c2d616c746368612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/grantholle/laravel-altcha)

This is a Laravel implementation for the server-side of [Altcha](https://altcha.org/), a proof-of-work captcha that does not require any third-party service.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require grantholle/laravel-altcha
```

Optionally, publish the config file with:

```
php artisan vendor:publish --tag="altcha-config"
```

Usage
-----

[](#usage)

In `.env` (or published config file), set the following variables:

```
# Required, sort of like a password
ALTCHA_HMAC_KEY=
# Optional, defaults to SHA-256. Can be SHA-384 or SHA-512
# ALTCHA_ALGORITHM="SHA-256"
```

Out of the box, the package registers a `/altcha-challenge` endpoint to use you on your frontend.

Frontend
--------

[](#frontend)

Following the [frontend integration](https://altcha.org/docs/website-integration), use the following snippet to get a challenge:

```

```

Implementation will be different given your frontend, but here's an example Vue component to use:

```

import 'altcha'

const emit = defineEmits(['update:modelValue'])
const stateChanged = ev => {
  if (ev.detail.state === 'verified') {
    emit('update:modelValue', ev.detail.payload)
  }
}

```

In an Inertja.js form, you could use this component like so:

```

    Email

    Password

    Submit

import { useForm } from '@inertiajs/inertia-vue3'
// This is the component we made above
import Altcha from '@/components/forms/Altcha.vue'

const form = useForm({
  email: null,
  password: null,
  token: null,
})

```

Backend validation
------------------

[](#backend-validation)

To validate the frontend-generated token/payload, there's a `ValidAltcha` rule you can use, assuming the token is passed as `token` in the request:

```
use GrantHolle\Altcha\Rules\ValidAltcha;

$request->validate([
    'email' => ['required', 'email'],
    'password' => ['required'],
    'altcha' => ['required', new ValidAltcha()],
]);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Grant Holle](https://github.com/grantholle)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance67

Regular maintenance activity

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

594d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b433d063453614f72ca29c6b8b62b5b79c009228ec1dfd5672dd415fdbe02644?d=identicon)[artisanbarista](/maintainers/artisanbarista)

---

Top Contributors

[![grantholle](https://avatars.githubusercontent.com/u/1189456?v=4)](https://github.com/grantholle "grantholle (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![artisanbarista](https://avatars.githubusercontent.com/u/15884915?v=4)](https://github.com/artisanbarista "artisanbarista (2 commits)")[![webdevartisan](https://avatars.githubusercontent.com/u/160753900?v=4)](https://github.com/webdevartisan "webdevartisan (2 commits)")[![mattstein](https://avatars.githubusercontent.com/u/2488775?v=4)](https://github.com/mattstein "mattstein (1 commits)")

---

Tags

laravelGrant Hollelaravel-altcha

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/artisanbarista-laravel-altcha/health.svg)

```
[![Health](https://phpackages.com/badges/artisanbarista-laravel-altcha/health.svg)](https://phpackages.com/packages/artisanbarista-laravel-altcha)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[grantholle/laravel-altcha

A Laravel server implementation for Altcha.

3338.7k1](/packages/grantholle-laravel-altcha)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
