Download the PHP package usercheck/usercheck-laravel without Composer
On this page you can find all versions of the php package usercheck/usercheck-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download usercheck/usercheck-laravel
More information about usercheck/usercheck-laravel
Files in usercheck/usercheck-laravel
Package usercheck-laravel
Short Description Laravel validation rule for UserCheck API
License MIT
Homepage https://github.com/usercheckhq/usercheck-laravel
Informations about the package usercheck-laravel
UserCheck for Laravel
A Laravel package for validating email addresses using the UserCheck.com API.
✨ Features
- Block disposable email addresses with an always up-to-date API
- Validate email addresses
- Check for MX records
- Identify personal email addresses
- Blocks custom domains (Paid plans only)
- Customizable validation rules
- Laravel Facade for easy use
- Localization support
Requirements
- PHP 8.0+
- Laravel 11.0+
Installation
Install the package via Composer:
Configuration
Add your UserCheck API key to your .env
file:
You can obtain a free API key by signing up at https://app.usercheck.com/register.
Usage
Use the usercheck
rule in your Laravel validation:
Options
By default, the usercheck
rule will only validate the email address's syntax using the UserCheck API. If the email is invalid, the validation will fail.
The usercheck
rule accepts several parameters:
block_disposable
: Fails validation if the email is from a disposable email providerblock_no_mx
: Fails validation if the domain has no MX recordsblock_public_domain
: Fails validation for public email domains (e.g., Gmail, Yahoo). Great to prevent users from signing up with their personal email addresses.domain_only
: Validates only the domain part of the email. Great for privacy; only the domain will be sent to the API.block_blocklisted
: (Paid plans only) Blocks domains from your custom blocklist.
You can combine these options to create a custom validation rule:
Using the Facade
You can also use the UserCheck facade directly:
Both methods return an array with is_valid
and error_code
keys.
Localization
The package includes English translations by default. To customize the error messages, publish the language files:
Then, edit the files in resources/lang/vendor/usercheck
.
Testing
Run the tests with:
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
Support
For support, please email [email protected] or open an issue on GitHub.