exeque/laravel-mosparo
Laravel Mosparo integrates the open-source Mosparo spam protection service into Laravel applications. Render the widget, validate form submissions server-side, and block spam with minimal configuration. Supports configurable hosts, credentials, and validation rules for a smooth developer experience.
Architecture fit
@mosparoScript, @mosparo), an anonymous-style component (<x-mosparo />), a validation rule (new ValidMosparo([...])), a Livewire trait (InteractsWithMosparo), a facade with read-only DTOs (ExeQue\Mosparo\Data), a common exception interface, an artisan command, and a fake(). This matches the framework's own extension points rather than inventing parallel ones.Integration feasibility
MOSPARO_ENABLED flag and Mosparo::fake() mean code can ship ahead of infrastructure and ahead of a signed-off rollout — a useful de-risking lever.Technical risk
ConnectionFailed / RequestFailed the behaviour (accept the submission = spam gets through, or reject = legitimate users blocked) is a product decision, not a library detail. It must be explicit, documented, and tested — not inherited from a default.Key questions
ConnectionFailed/RequestFailed — fail-open or fail-closed — and is it configurable?@mosparoScript support CSP nonces/hashes for strict-CSP applications?flushCache()/mosparo:clear-cache scoping), and how are keys namespaced across multiple projects and tenants?statistics() surface or transmit anything that affects our privacy position?Stack fit
Migration path
MOSPARO_ENABLED=false lets the integration land and be tested in production code paths before the service is mandatory, and gives a documented kill switch if the mosparo server misbehaves. Ensure that flag is itself monitored — a kill switch left on is silent zero protection.Compatibility
Sequencing
Mosparo::fake() with accept/reject/sequence cases into the pipeline so spam paths are regression-tested, not assumed.Maintenance
mosparo:clear-cache is scoped so cache hygiene is safe to automate.Support
Scaling
Failure modes
ConnectionFailed. Behaviour must match the documented policy; test it deliberately, not accidentally in production.UnknownProject / RequestFailed. Every submission fails at once; needs alerting on the exception rate, not just 500s.IncompleteProject. Misconfiguration; ideally surfaced at deploy/boot rather than at a user's first submission.MOSPARO_ENABLED=false in production produces zero protection with zero visible symptom. Add a config assertion and a monitoring check.flushCache() and mosparo:clear-cache are the remedies and should be in the runbook.Ramp-up
fake() plus MOSPARO_ENABLED=false make local work and tests straightforward.fake(), and where the mosparo server lives and how it is alerted on.Recommendation: treat v0.1.0 as a time-boxed evaluation, not a standard. Gate adoption on (a) an eligible Laravel 13/PHP 8.4 application, (b) an explicit fail-open/fail-closed decision, and (c) a confirmed licence and support posture. Adopt broadly only at 1.0, or earlier if the privacy advantage is decisive and the integration is isolated behind our own interface. Pin the exact version either way.
How can I help you explore Laravel packages today?