Download the PHP package truelist/laravel without Composer
On this page you can find all versions of the php package truelist/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download truelist/laravel
More information about truelist/laravel
Files in truelist/laravel
Package laravel
Short Description Laravel integration for Truelist.io email validation
License MIT
Homepage https://github.com/Truelist-io-Email-Validation/truelist-laravel
Informations about the package laravel
truelist/laravel
Email validation for Laravel, powered by Truelist.io.
Validate email deliverability in your Laravel forms with a single line:
Truelist checks whether an email address actually exists and can receive mail, catching typos, disposable addresses, and invalid mailboxes before they hit your database.
Start free — 100 validations + 10 enhanced credits, no credit card required. Get your API key →
Installation
The service provider is auto-discovered. To publish the config file:
Add your API key to .env:
Quick Start
That's it. Invalid emails will now fail validation with a clear error message.
Configuration
Publish the config file to customize settings:
This creates config/truelist.php:
Validation Rule
Using the rule object (recommended)
Using the string shorthand
Behavior on errors
The validation rule fails open by design. If the Truelist API is unreachable (timeout, 500, rate limit), the email passes validation so your forms keep working.
Authentication errors (invalid API key) always throw an exception -- you want to know immediately if your credentials are wrong.
Using the Client Directly
Facade Usage
States
| State | Meaning |
|---|---|
ok |
Email is valid and deliverable |
email_invalid |
Email is invalid or undeliverable |
accept_all |
Domain accepts all emails (risky) |
unknown |
Could not determine status |
Sub-states
| Sub-state | Meaning |
|---|---|
email_ok |
Email is valid and deliverable |
is_disposable |
Disposable/temporary email |
is_role |
Role-based address (info@, admin@) |
accept_all |
Domain accepts all emails |
failed_mx_check |
Domain has no mail server |
failed_spam_trap |
Known spam trap address |
failed_no_mailbox |
Mailbox does not exist |
failed_greylisted |
Server temporarily rejected (greylisting) |
failed_syntax_check |
Email format is invalid |
unknown |
Could not determine status |
Caching
Enable caching to avoid redundant API calls for recently validated emails:
Caching uses Laravel's default cache driver. Only successful results are cached -- unknowns and errors are never cached, so a subsequent request can get the real result.
The cache key is based on the lowercase, trimmed email address.
Error Handling
By default, API errors (timeouts, rate limits, server errors) return an unknown result with isError() returning true. This prevents your forms from breaking when the API is unreachable.
To raise exceptions instead:
Exception classes:
| Exception | Trigger |
|---|---|
Truelist\Exceptions\TruelistException |
Base exception class |
Truelist\Exceptions\AuthenticationException |
Invalid API key (401) -- always thrown |
Truelist\Exceptions\RateLimitException |
Rate limit exceeded (429) |
Truelist\Exceptions\ApiException |
Other API errors (500, timeouts, etc.) |
Testing
Mock the HTTP client in your tests to avoid real API calls:
Or mock the client directly:
Requirements
- PHP >= 8.1
- Laravel 10, 11, or 12
Development
Getting Started
Sign up for a free Truelist account to get your API key. The free plan includes 100 validations and 10 enhanced credits — no credit card required.
License
Released under the MIT License.
All versions of laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/validation Version ^10.0|^11.0|^12.0