Skip to content

Commit e8a0544

Browse files
committed
Init commit
0 parents  commit e8a0544

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Theo Kouzelis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Laravel Validator Rules - Email Validation Mailgun
2+
A email validation that uses the [Mailgun API](https://documentation.mailgun.com/en/latest/api-email-validation.html#email-validation) for a three-step validation check.
3+
4+
To find examples of how validation rules can be applied in the Laravel framework, please view the [validation docs](https://laravel.com/docs/5.6/validation).
5+
6+
## Install
7+
Require via composer.
8+
```
9+
composer require kouz/laravel-mailgun-email-validation
10+
```
11+
For Laravel >=5.5 the package will be discoverd. For Laravel <=5.4 add package to list of service providers in config/app.php
12+
```
13+
<?php
14+
//config/app.php
15+
16+
'providers' => [
17+
Kouz\LaravelMailgunValidation\ServiceProvider::class,
18+
],
19+
```
20+
Publish and fill out the config/mailgun-email-validation.php file with your Mailgun API key.
21+
```
22+
php artisan vendor:publish --provider="Kouz\LaravelMailgunValidation\ServiceProvider"
23+
```
24+
25+
## Basic Usage
26+
Use the following rule to validate your email fields. The rule will first check the address against
27+
PHP's [FILTER_VALIDATE_EMAIL](http://php.net/manual/en/filter.filters.validate.php) and then will call
28+
the Mailgun API.
29+
30+
**mailgun_email:role,disposable,mailbox,strict**
31+
The field under validation must be formatted as an e-mail address. The following flags can be added to
32+
apply additional validation:
33+
34+
* **role** Don't allow role-based addresses.
35+
* **disposable** Don't allow disposable email domains.
36+
* **mailbox** Verify mailbox. Add strict flag to ensure that Mailgun was able to verify a mailbox and didn't return "Unknown".
37+
* **strict** Always require a response from Mailgun to validate. By default if a API request fails, the validation will pass. The strict flag ensures that a Mailgun response was recieved.
38+
39+
## License
40+
This project is licensed under a MIT License which you can find
41+
[in this LICENSE](https://github.com/TheoKouzelis/laravel-mailgun-email-validation/blob/master/LICENSE).
42+
43+
## Feedback
44+
If you have any feedback, comments or suggestions, please feel free to open an issue within this repository.
45+
46+
## Laravel Validation Rules
47+
This package is part of the Laravel Validation Rules collection. If you're after more useful validation rules,
48+
head to the [Laravel Validation Rules](https://laravel-validation-rules.github.io/) website.

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "laravel-validation-rules/email-validation-mailgun",
3+
"description": "Metapackage for https://github.com/TheoKouzelis/laravel-mailgun-email-validation",
4+
"type": "metapackage",
5+
"require": {
6+
"kouz/laravel-mailgun-email-validation": "^1.0"
7+
},
8+
"license": "MIT"
9+
}

0 commit comments

Comments
 (0)