Looking to hire Laravel developers? Try LaraJobs

laravel maintained by nexmailpro

Description
Official Laravel integration for the NexMailPro email verification API.
Last update
2026/07/02 14:16 (dev-main)
License
Links
Downloads
0

Comments
comments powered by Disqus

NexMailPro Laravel Package

Official Laravel integration for the NexMailPro email verification API.

This package depends on nexmailpro/php-sdk and adds Laravel-native configuration, a facade, dependency injection support, a validation rule, and an Artisan test command.

Requirements

  • PHP 8.2+
  • Laravel 10, 11, or 12

Installation

composer require nexmailpro/laravel

Laravel package discovery will register the service provider and facade automatically.

If you want to publish the config file:

php artisan vendor:publish --tag=nexmailpro-config

Configuration

Add your environment variables:

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

The published config file lives at config/nexmailpro.php.

Usage

Facade

use NexMailPro\Laravel\Facades\NexMailPro;

$response = NexMailPro::verifyEmail('test@gmail.com');

Dependency Injection

use NexMailPro\Laravel\NexMailProManager;

$manager = app(NexMailProManager::class);

$response = $manager->verifyEmail('test@gmail.com', [
    'source' => 'signup-form',
]);

Validation Rule

use NexMailPro\Laravel\Rules\NexMailProEmail;

$validated = validator(
    ['email' => 'test@gmail.com'],
    ['email' => ['required', 'email', new NexMailProEmail()]],
)->validate();

The rule passes valid responses by default. If you want to allow risky results too:

new NexMailProEmail(allowRisky: true)

Artisan Command

php artisan nexmailpro:test test@gmail.com

The command prints the JSON response returned by NexMailPro.

Testing

Install dependencies and run the package test suite:

composer install
composer test

License

MIT