nexmailpro/laravel
Composer 安装命令:
composer require nexmailpro/laravel
包简介
Official Laravel integration for the NexMailPro email verification API.
README 文档
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
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-02