PHPackages                             mahou/mosparo-bundle - 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. [Security](/categories/security)
4. /
5. mahou/mosparo-bundle

ActiveSymfony-bundle[Security](/categories/security)

mahou/mosparo-bundle
====================

A Symfony bundle for mosparo spam protection

1.4.1(5mo ago)133MITPHPPHP &gt;=8.0.2CI passing

Since Apr 7Pushed 5mo agoCompare

[ Source](https://github.com/Digi92/mosparo-bundle)[ Packagist](https://packagist.org/packages/mahou/mosparo-bundle)[ Docs](https://github.com/Digi92/mosparo-bundle)[ Fund](https://ko-fi.com/arnaudritti)[ RSS](/packages/mahou-mosparo-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (21)Versions (7)Used By (0)

 [![mosparo logo contains a bird with the name Mo and the mosparo text](https://github.com/mosparo/mosparo/raw/master/assets/images/mosparo-logo.svg?raw=true)](https://github.com/mosparo/mosparo/blob/master/assets/images/mosparo-logo.svg?raw=true)

 Symfony Bundle
================

[](#----symfony-bundle)

 This bundle adds the required functionality to use mosparo in your Symfony form.

[![GitHub](https://camo.githubusercontent.com/2437114caa5540983db65c8214129984af7d7f89dc0e64ab59868a60f9024e2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4469676939322f6d6f737061726f2d62756e646c65)](https://camo.githubusercontent.com/2437114caa5540983db65c8214129984af7d7f89dc0e64ab59868a60f9024e2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4469676939322f6d6f737061726f2d62756e646c65)[![GitHub checks](https://github.com/Digi92/mosparo-bundle/actions/workflows/release.yaml/badge.svg)](https://github.com/Digi92/mosparo-bundle/actions/workflows/release.yaml)[![GitHub release (latest SemVer)](https://camo.githubusercontent.com/efffec07e448764e44ae48d37abc960deeecb2ca41ea82da63a134ac4dc57084/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f4469676939322f6d6f737061726f2d62756e646c65)](https://camo.githubusercontent.com/efffec07e448764e44ae48d37abc960deeecb2ca41ea82da63a134ac4dc57084/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f4469676939322f6d6f737061726f2d62756e646c65)

---

Description
-----------

[](#description)

With this PHP library you can connect to a mosparo installation and verify the submitted data.

Requirements
------------

[](#requirements)

To use the plugin, you must meet the following requirements:

- A mosparo project
- Symfony 5.4 or greater
- PHP 8.0 or greater

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

[](#installation)

Install this bundle by using composer:

```
composer require Digi92/mosparo-bundle

```

Configuration
-------------

[](#configuration)

### 1. Register the bundle

[](#1-register-the-bundle)

Register bundle into `config/bundles.php`:

```
return [
    //...
    Mosparo\MosparoBundle\MosparoBundle::class => ['all' => true],
];
```

### 2. Add configuration files

[](#2-add-configuration-files)

Setup bundle's config into `config/packages/mosparo.yaml`:

```
mosparo:
  instance_url: '%env(MOSPARO_INSTANCE_URL)%'
  uuid: '%env(MOSPARO_UUID)%'
  public_key: '%env(MOSPARO_PUBLIC_KEY)%'
  private_key: '%env(MOSPARO_PRIVATE_KEY)%'
```

Add your variables to your .env file:

```
###> mosparo/mosparo-bundle ###
MOSPARO_INSTANCE_URL=https://example.com
MOSPARO_UUID=
MOSPARO_PUBLIC_KEY=
MOSPARO_PRIVATE_KEY=
###< mosparo/mosparo-bundle ###

```

### Handle multiples configurations

[](#handle-multiples-configurations)

Into your configuration file. ex: `config/packages/mosparo.yaml`:

```
mosparo:
  default_project: '%env(MOSPARO_DEFAULT)%'
  projects:
    forms:
      instance_url: '%env(MOSPARO_FORMS_INSTANCE_URL)%'
      uuid: '%env(MOSPARO_FORMS_UUID)%'
      public_key: '%env(MOSPARO_FORMS_PUBLIC_KEY)%'
      private_key: '%env(MOSPARO_FORMS_PRIVATE_KEY)%'
    login:
      instance_url: '%env(MOSPARO_LOGIN_INSTANCE_URL)%'
      uuid: '%env(MOSPARO_LOGIN_UUID)%'
      public_key: '%env(MOSPARO_LOGIN_PUBLIC_KEY)%'
      private_key: '%env(MOSPARO_LOGIN_PRIVATE_KEY)%'
```

Inside your `.env` files

```
###> mosparo/mosparo-bundle ###
MOSPARO_DEFAULT=

MOSPARO_FORMS_INSTANCE_URL=
MOSPARO_FORMS_UUID=
MOSPARO_FORMS_PUBLIC_KEY=
MOSPARO_FORMS_PRIVATE_KEY=

MOSPARO_LOGIN_INSTANCE_URL=
MOSPARO_LOGIN_UUID=
MOSPARO_LOGIN_PUBLIC_KEY=
MOSPARO_LOGIN_PRIVATE_KEY=
###< mosparo/mosparo-bundle ###

```

Usage
-----

[](#usage)

### How to integrate mosparo in Symfony form:

[](#how-to-integrate-mosparo-in-symfony-form)

```
