mirror of
https://github.com/elyby/yii2-tempmail-validator.git
synced 2024-11-26 16:52:17 +05:30
Update README
This commit is contained in:
parent
e2ae355a60
commit
92d74e3369
24
README.md
24
README.md
@ -4,16 +4,15 @@
|
|||||||
[![Software License][ico-license]](LICENSE.md)
|
[![Software License][ico-license]](LICENSE.md)
|
||||||
[![Total Downloads][ico-downloads]][link-downloads]
|
[![Total Downloads][ico-downloads]][link-downloads]
|
||||||
|
|
||||||
Yii2 validator, based on [https://github.com/elyby/php-tempmailbuster](https://github.com/elyby/php-tempmailbuster)
|
Yii2 validator, based on [daveearley/Email-Validation-Tool](https://github.com/daveearley/Email-Validation-Tool)
|
||||||
library and [https://github.com/elyby/anti-tempmail-repo](https://github.com/elyby/anti-tempmail-repo) reference.
|
to protect your site from users, who use 10-minutes mail services.
|
||||||
Helps to protect you site from users, who use 10-minutes mail services.
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Install the latest version with
|
Install the latest version with
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ composer require "ely/yii2-tempmail-validator:~1.0.0"
|
$ composer require ely/yii2-tempmail-validator
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@ -24,22 +23,7 @@ Once the extension is installed, simply use it in your models:
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['email'], \Ely\Yii2\TempmailValidator::className()],
|
[['email'], \Ely\Yii2\TempmailValidator::class],
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Also you can configure validator:
|
|
||||||
|
|
||||||
```php
|
|
||||||
public function rules()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
[['email'], \Ely\Yii2\TempmailValidator::className(),
|
|
||||||
'message' => '{attribute} is tempmail. You will not pass',
|
|
||||||
'whiteList' => false,
|
|
||||||
'secondaryStorage' => ['spam4\.me'],
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user