Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
madeITBelgium committed Jun 19, 2017
1 parent 877a394 commit 74b6ce6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[![Total Downloads](https://poser.pugx.org/madeITBelgium/Laravel-Email-Domain-Validation/d/total.svg)](https://packagist.org/packages/madeITBelgium/Laravel-Email-Domain-Validation)
[![License](https://poser.pugx.org/madeITBelgium/Laravel-Email-Domain-Validation/license.svg)](https://packagist.org/packages/madeITBelgium/Laravel-Email-Domain-Validation)

#Installation
With this Laravel package you can validate email input that it contains or not contains a specific domainname. This is useful to create a registration to restrict registrions for the company email domain.

# Installation

Require this package in your `composer.json` and update composer.

Expand All @@ -27,7 +29,19 @@ You can use the facade for shorter code. Add this to your aliases:
```

# Documentation
### Laraval validator
## Usage
```php
$emailDomain = new EmailDomain('info@madeit.be', ['madeit.be'], ['tpweb.org']);
$emailDomain->isEmailValid() //Checks if the given e-mail address is valid
$emailDomain->areAllowedDomainsValid(); //Check if the given allowed domains are valid
$emailDomain->areNotAllowedDomainsValid()


$emailDomain->isEmailAllowed() //Check if the email address is allowed.
$emailDomain->isEmailAllowed('info@madeit.be', ['madeit.be'], ['example.com']));
```

## Laraval validator
```php
public function store(Request $request) {
$this->validate($request, ['email' => 'required|email|domain:madeit.be,hotmail.com|domainnot:gmail.com,yahoo.com']);
Expand All @@ -43,7 +57,6 @@ Support github or mail: tjebbe.lievens@madeit.be
# Contributing

Please try to follow the psr-2 coding style guide. http://www.php-fig.org/psr/psr-2/
t
# License

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

0 comments on commit 74b6ce6

Please sign in to comment.