Skip to content

jakeryansmith/validate-string-of-emails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Laravel validation rule for checking a string of delimiter separated emails.

You can install the package via composer:

composer require jakeryansmith/laravel-validate-emails

You can validate a string of emails separated by a comma.

$request['emails'] = 'dwightschrute@dundermifflin.com,jimhalpert@dundermifflin.com';
$request->validate([
    'emails' => [new StringOfEmails()],
]);

You can also pass in your own delimiter if needed. In this example we are using the '|' pipe character.

$request['emails'] = 'dwightschrute@dundermifflin.com|jimhalpert@dundermifflin.com';
$request->validate([
    'emails' => [new StringOfEmails('|')],
]);

License

The MIT License (MIT). Please see License File for more information.