# Ploi Setup: Email Validation with an Environment Key

URL: https://email-validation.org/docs/guides/ploi/
Updated: 2026-12-04

> Documentation index: https://email-validation.org/llms.txt

Ploi deploys your app; the check runs in your app's code. For a Laravel app that is our
[Laravel validation rule](https://email-validation.org/docs/guides/laravel/), which rejects an address that cannot receive email in any form
request. Ploi's part is the key: it goes in the site's `.env` file through Ploi's environment editor, never in your
repository. Ploi adds nothing of its own and needs no plugin.

By default the rule never stops a real person when the API cannot answer in time: the address passes and a warning
goes to your log (`EV_FAIL_OPEN`, below).

## Add the rule to your app

Install the package in your app as the [Laravel guide](https://email-validation.org/docs/guides/laravel/#install) says: it is not on Packagist
yet, so commit the downloaded zip in a folder of your repository (for example `packages/`) with the Composer
repository line, and commit `composer.json` and `composer.lock`. Ploi's deploy script then installs it with the rest
of your dependencies. Add the rule to your form requests:

```php
'email' => ['bail', 'required', 'email', new ValidEmail()],
```

## The key in Ploi

1. Create an API key on the [API keys page](https://email-validation.org/app/api-keys/) with the permission "Validate addresses", one for each
   site, with a [daily credit cap](https://email-validation.org/docs/authentication/#limits). Put the form's route behind Laravel's `throttle`
   middleware: each address a visitor sends can use a credit.
2. In Ploi, open the site and edit its environment (the site's `.env` file), and add:

   ```bash
   EV_API_KEY=your-api-key
   ```

3. If your app caches its configuration (`php artisan config:cache`, usual in a production deploy script), run it
   again, or deploy again, so the app reads the new value. Restart queue workers if you validate in queued jobs.

Optional settings go in the same file: `EV_BLOCK_DISPOSABLE=true` to reject throwaway inboxes too,
`EV_FAIL_OPEN=false` to fail the field when the check cannot finish, and `EV_BASE_URL=https://api-eu.email-validation.org` for
[EU data residency](https://email-validation.org/docs/eu-data-residency/) (the same key works on both). The [settings](https://email-validation.org/docs/guides/laravel/#settings)
list every one.

## Try it

Send the form with `no_mailbox@sandbox.email-validation.org`: the field fails. `accepted@sandbox.email-validation.org` passes. These
[test addresses](https://email-validation.org/docs/test-addresses/) cost nothing and contact no mail server.

## Not a Laravel app

Ploi also runs other PHP apps and Node.js apps. The environment editor writes the same `.env` file, which your app
loads itself (in Node.js, for example, with `node --env-file=.env`). Read `EV_API_KEY` from the environment with one
of our [SDKs](https://email-validation.org/docs/sdks/), such as the [PHP](https://email-validation.org/docs/sdks/php/) or the [JavaScript](https://email-validation.org/docs/sdks/javascript/) one, and
let the form through when the check fails, so an outage on our side never stops a visitor. There are official SDKs for JavaScript/TypeScript, Python, Go, PHP, Ruby, C#, Rust and Swift; those for Java, Kotlin, Dart, Elixir, C and Perl are built and tested and coming soon to their package registries.

Ploi's own documentation: [its documentation](https://ploi.io/documentation) and the
[.env endpoints of its API](https://developers.ploi.io/environment/update-env-from-site).

## Related

- [Laravel](https://email-validation.org/docs/guides/laravel/)
- [Laravel Forge](https://email-validation.org/docs/guides/laravel-forge/)
- [Authentication and key limits](https://email-validation.org/docs/authentication/)

## More on Ploi

- [Ploi email validation integration](https://email-validation.org/integrations/ploi/)
