sarfrazrizwan/laravel-zerobounce
.env), but assumes familiarity with Laravel’s service binding and facades.ZeroBounceServiceProvider, making it easy to bind the SDK to the container.ZeroBounce facade for concise syntax (e.g., ZeroBounce::validate($email)).EmailValidated events).email_validations table).composer require sarfrazrizwan/laravel-zerobounce
Publish config (if customization is needed):
php artisan vendor:publish --provider="Sarfrazrizwan\ZeroBounce\ZeroBounceServiceProvider"
.env:
ZEROBOUNCE_API_KEY=your_api_key_here
Configure in config/zerobounce.php (if published).use Sarfrazrizwan\ZeroBounce\Facades\ZeroBounce;
$result = ZeroBounce::validate($email);
Or via dependency injection:
public function __construct(private ZeroBounce $zeroBounce) {}
ZeroBounce facade in unit tests:
ZeroBounce::shouldReceive('validate')->andReturn($mockResult);
guzzlehttp/guzzle for HTTP calls).retry helper)..env/config, reducing drift risk.php artisan config:cache) in production for performance.429 for rate limits). The package may not expose these explicitly; custom error handling may be needed.validateEmailJob) to decouple from user flow.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| ZeroBounce API downtime | Validation fails silently | Fallback to local cache or alternative provider (e.g., NeverBounce). |
| Rate limit exceeded | 429 Too Many Requests |
Implement retries with jitter; use queues to space requests. |
| Invalid API key | All validations fail | Validate .env on app boot; use Laravel’s |
How can I help you explore Laravel packages today?