Official Laravel Documentation

Laravel Package

Install the official NexMailPro Laravel package to configure the API once, verify emails through a facade, add a validation rule to forms, and test the integration from Artisan.

Published package details

Composer package

nexmailpro/laravel

Facade class

NexMailPro\Laravel\Facades\NexMailPro

Validation rule

NexMailPro\Laravel\Rules\NexMailProEmail

CLI command

php artisan nexmailpro:test

LAR

NexMailPro Laravel

Facade, validation, config, and Artisan workflows

Supports Laravel 10, 11, and 12 with package discovery.
Uses your NEXMAILPRO_API_KEY environment value.
Reuses the same verification API documented in the REST API reference.

1. Installation

Install the official package from Packagist with Composer. The published README states that Laravel package discovery registers the service provider and facade automatically.

composer require nexmailpro/laravel

2. Environment Setup

Add your NexMailPro credentials to the Laravel environment so the package can send API requests from your application.

NEXMAILPRO_API_KEY=
NEXMAILPRO_BASE_URL=https://nexmailpro.com/api/v1

3. Facade Usage

Use the published facade to verify an email address from controllers, jobs, actions, or service classes inside your Laravel application.

use NexMailPro\Laravel\Facades\NexMailPro;

$response = NexMailPro::verifyEmail('[email protected]');

4. Validation Rule Usage

The package ships with a dedicated validation rule class so you can enforce real email verification during form submission. By default, the rule passes only valid responses.

use NexMailPro\Laravel\Rules\NexMailProEmail;

$validated = validator(
    ['email' => '[email protected]'],
    ['email' => ['required', 'email', new NexMailProEmail()]],
)->validate();

If your workflow should allow risky addresses too, initialize the rule with allowRisky: true.

new NexMailProEmail(allowRisky: true)

5. Artisan Command

Use the package Artisan command to test connectivity and inspect the raw JSON response from your Laravel app environment.

php artisan nexmailpro:test [email protected]

6. Features

✓ Laravel-Native

Laravel package discovery registers the service provider and facade automatically.

✓ Facade Access

Use the NexMailPro facade to verify email addresses from controllers, jobs, and services.

✓ Validation Rule

Ship real email verification into request validation with the dedicated rule class.

✓ Artisan Testing

Run a quick CLI verification command from the application environment.

✓ Configurable

Set your API key and base URL in the environment and publish config when needed.

✓ Built on the SDK

The Laravel package depends on the official NexMailPro PHP SDK under the hood.

8. FAQ

How do I install the NexMailPro Laravel package? +

Install the package with Composer by running composer require nexmailpro/laravel in your Laravel project.

Does Laravel register the package automatically? +

Yes. The published README says Laravel package discovery registers the service provider and facade automatically.

Which validation rule class should I use? +

Use NexMailPro\Laravel\Rules\NexMailProEmail in your validation rules. It passes valid responses by default and can optionally allow risky results.

Is there an Artisan command for quick testing? +

Yes. Run php artisan nexmailpro:test [email protected] to print the JSON response returned by NexMailPro.

Need help?

9. Need Help

Review the REST API reference, inspect the open-source Laravel package, or contact NexMailPro support if you need help shipping your Laravel integration.