mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Trying to use the email_array translation
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
69c43c610c
commit
d9be2b5a5e
|
@ -31,6 +31,7 @@ class ValidationServiceProvider extends ServiceProvider
|
||||||
Validator::extend('email_array', function ($attribute, $value, $parameters, $validator) {
|
Validator::extend('email_array', function ($attribute, $value, $parameters, $validator) {
|
||||||
$value = str_replace(' ', '', $value);
|
$value = str_replace(' ', '', $value);
|
||||||
$array = explode(',', $value);
|
$array = explode(',', $value);
|
||||||
|
$email_to_validate = [];
|
||||||
|
|
||||||
foreach ($array as $email) { //loop over values
|
foreach ($array as $email) { //loop over values
|
||||||
$email_to_validate['alert_email'][] = $email;
|
$email_to_validate['alert_email'][] = $email;
|
||||||
|
@ -38,7 +39,7 @@ class ValidationServiceProvider extends ServiceProvider
|
||||||
|
|
||||||
$rules = ['alert_email.*'=>'email'];
|
$rules = ['alert_email.*'=>'email'];
|
||||||
$messages = [
|
$messages = [
|
||||||
'alert_email.*'=>trans('validation.email_array'),
|
'alert_email.*' => trans('validation.custom.email_array'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$validator = Validator::make($email_to_validate, $rules, $messages);
|
$validator = Validator::make($email_to_validate, $rules, $messages);
|
||||||
|
|
Loading…
Reference in a new issue