New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

exeque/laravel-mosparo

mosparo spam protection for Laravel and Livewire: a configured client, a validation rule, a Blade box and a Livewire form that asks for fresh tokens after every check.
164
Install
composer require exeque/laravel-mosparo
Latest Version:v0.4.0
PHP:^8.4
Laravel:13
License:MIT
Last Updated:Oct 26, 2026
Links: GitHub  ·  Packagist
Maintainer: ExeQue

laravel-mosparo - spam protection for Laravel and Livewire, without the captcha

Latest version Total downloads Tests Documentation PHP version Laravel version License

Laravel × mosparo

Documentation: exeque.github.io/laravel-mosparo

mosparo spam protection for Laravel and Livewire. Put the box in a form with one directive, and check the submission with a validation rule, a Livewire trait or a facade, naming the fields mosparo must have checked.

Install

composer require exeque/laravel-mosparo
MOSPARO_HOST=https://mosparo.example.com
MOSPARO_UUID=your-project-uuid
MOSPARO_PUBLIC_KEY=your-public-key
MOSPARO_PRIVATE_KEY=your-private-key

Use

<head>
    @mosparoScript
</head>

<form method="post" action="/newsletter">
    @csrf
    <input name="email" type="email">

    @mosparo
    @mosparoError <p class="error">{{ $message }}</p> @enderror

    <button type="submit">Subscribe</button>
</form>

A plain form post is checked by a validation rule:

use ExeQue\Mosparo\Rules\ValidMosparo;

'_mosparo_submitToken' => [ValidMosparo::make(['email'])],

A Livewire component uses the trait:

use ExeQue\Mosparo\Livewire\Concerns\InteractsWithMosparo;
use Livewire\Component;

class SignIn extends Component
{
    use InteractsWithMosparo;

    public SignInForm $form;

    public function signIn(): void
    {
        if (! $this->mosparo->verify($this->form, ['email'])) {
            return;
        }

        // ...
    }
}

Anything else asks the facade:

use ExeQue\Mosparo\Facades\Mosparo;

Mosparo::passes($formData, $submitToken, $validationToken, ['email', 'message']);

Features

Read on in the documentation.

License

The code is MIT; see LICENSE.md.

The cover shows Mo, the sparrow, by mosparo, licensed under CC BY-SA 4.0. The cover and the other artwork in art/ are CC BY-SA 4.0 as well; see art/LICENSE.md. mosparo and Laravel do not endorse this package.

Related Packages

luacap/captcha

Captcha library for Laravel framework.

37 0
devfactory/mollom

Mollom for laravel 4

415 5
zablose/captcha

Simple captcha with optional goodies for Laravel.

7,846 6
climactic/laravel-altcha

ALTCHA proof-of-work spam protection for Laravel — drop-in middleware, validatio...

1,653 3

Version History

Version Released PHP Laravel License
v0.4.0 ^8.4 ^13.0 MIT
v0.3.0 ^8.4 ^13.0 MIT
v0.2.0 ^8.4 ^13.0 MIT
v0.1.3 ^8.4 ^13.0 MIT
v0.1.2 ^8.4 ^13.0 MIT