nexmailpro / laravel
Official Laravel integration for the NexMailPro email verification API.
v1.0.0
2026-07-02 12:16 UTC
Requires
- php: ^8.2
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/validation: ^10.0|^11.0|^12.0
- nexmailpro/php-sdk: ^1.0
Requires (Dev)
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.5
README
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